Integrating #55 and #78

v0.27.3
clanmills 8 years ago
parent 75935516e3
commit e3298ab5e1

@ -44,6 +44,7 @@
#include <sstream> #include <sstream>
#include <memory> #include <memory>
#include <cstring> #include <cstring>
#include <climits>
// ***************************************************************************** // *****************************************************************************
// namespace extensions // namespace extensions
@ -1662,7 +1663,7 @@ namespace Exiv2 {
template<> template<>
inline long ValueType<Rational>::toLong(long n) const inline long ValueType<Rational>::toLong(long n) const
{ {
ok_ = (value_[n].second != 0); ok_ = (value_[n].second != 0 && INT_MIN < value_[n].first && value_[n].first < INT_MAX );
if (!ok_) return 0; if (!ok_) return 0;
return value_[n].first / value_[n].second; return value_[n].first / value_[n].second;
} }

Loading…
Cancel
Save