diff --git a/include/exiv2/value.hpp b/include/exiv2/value.hpp index b61c0f441b..2078c6bdbb 100644 --- a/include/exiv2/value.hpp +++ b/include/exiv2/value.hpp @@ -1663,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; } diff --git a/test/bugfixes-test.sh b/test/bugfixes-test.sh index f91c6759d0..c90ae55939 100755 --- a/test/bugfixes-test.sh +++ b/test/bugfixes-test.sh @@ -602,6 +602,7 @@ source ./functions.source runTest exiv2 -pX $filename | xmllint --format - num=1231 + printf "$num " >&3 for X in a b; do filename=exiv2-bug$num$X.jpg echo '------>' Bug $filename '<-------' >&2 @@ -622,6 +623,7 @@ source ./functions.source runTest exiv2 -pa $filename num=1252 + printf "$num " >&3 for X in a b; do filename=exiv2-bug$num$X.exv echo '------>' Bug $filename '<-------' >&2 @@ -629,6 +631,13 @@ source ./functions.source runTest exiv2 -pa --grep lens/i $filename done + num=g55 + printf "$num " >&3 + filename=POC8 + echo '------>' Bug $filename '<-------' >&2 + copyTestFile $filename + runTest exiv2 $filename 2>/dev/null + ) 3>&1 > $results 2>&1 printf "\n" diff --git a/test/data/bugfixes-test.out b/test/data/bugfixes-test.out index d875402521..53d45dc5bc 100644 Binary files a/test/data/bugfixes-test.out and b/test/data/bugfixes-test.out differ