From 8a8f60a4e7089fe7bb597770a2daab24a3941d3e Mon Sep 17 00:00:00 2001 From: clanmills Date: Tue, 26 Sep 2017 21:37:53 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20https://github.com/Exiv2/exiv2/issues/55?= =?UTF-8?q?=20=20Thank=20You,=20Rapha=C3=ABl=20Hertzog.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/exiv2/value.hpp | 2 +- test/bugfixes-test.sh | 12 +++++++++++- test/data/bugfixes-test.out | Bin 1932329 -> 1932864 bytes 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/exiv2/value.hpp b/include/exiv2/value.hpp index 64a8ca7f..e5ae71fd 100644 --- a/include/exiv2/value.hpp +++ b/include/exiv2/value.hpp @@ -1662,7 +1662,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 c8f95ce2..72c9eb07 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 @@ -630,6 +632,7 @@ source ./functions.source done num=g20 + printf "$num " >&3 filename=exiv2-$num.exv echo '------>' Bug $filename '<-------' >&2 copyTestFile $filename @@ -643,13 +646,20 @@ source ./functions.source runTest exiv2 -pa --grep lenstype/i $filename done - num=g45 + printf "$num " >&3 filename=exiv2-$num.exv echo '------>' Bug $filename '<-------' >&2 copyTestFile $filename runTest exiv2 -pa --grep lens/i $filename + 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 4ee3f2d8160f9a1119cfae9f79c9ddc2e4e84c16..3bcd776b78a1f14cc49ac28f2143e8288acccbfe 100644 GIT binary patch delta 577 zcmYk2$w~u35Qd4nF!~s2NDtDq29q~@a_Zn zSROn$TQXCp?yvv>(bEx1E6kdxuDhK1iLBu;-yUo7D3zp0nalwPrKKbB zXXmC+ypN`PYJ=}0_R@rW6A^BaxLc^v006)Pj7U^b;s6XtM`7{H&@%vISy1r5?bGs~egdJ$$=Su#&0Xvvk;>!> SrKgv-%Ewo&(dzW;FwO@!S{6hA