Integrating #55 and #78

This commit is contained in:
clanmills 2017-09-26 22:32:27 +01:00
parent 75935516e3
commit e3298ab5e1

View File

@ -44,6 +44,7 @@
#include <sstream>
#include <memory>
#include <cstring>
#include <climits>
// *****************************************************************************
// namespace extensions
@ -1662,7 +1663,7 @@ namespace Exiv2 {
template<>
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;
return value_[n].first / value_[n].second;
}