From e3298ab5e172cc1a2573befdf463cca28950cbb1 Mon Sep 17 00:00:00 2001 From: clanmills Date: Tue, 26 Sep 2017 22:32:27 +0100 Subject: [PATCH] Integrating #55 and #78 --- include/exiv2/value.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/exiv2/value.hpp b/include/exiv2/value.hpp index 64a8ca7f..2078c6bd 100644 --- a/include/exiv2/value.hpp +++ b/include/exiv2/value.hpp @@ -44,6 +44,7 @@ #include #include #include +#include // ***************************************************************************** // namespace extensions @@ -1662,7 +1663,7 @@ namespace Exiv2 { template<> inline long ValueType::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; }