From 88ec8b88ea460146a044eafea73ef635f73b8ad0 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Thu, 6 Dec 2018 19:56:41 +0000 Subject: [PATCH] Fix #562 for 32 bit builds (don't throw arithmetic exception). --- src/tiffvisitor_int.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tiffvisitor_int.cpp b/src/tiffvisitor_int.cpp index a03cef19..b633a96a 100644 --- a/src/tiffvisitor_int.cpp +++ b/src/tiffvisitor_int.cpp @@ -1523,7 +1523,7 @@ namespace Exiv2 { if ((static_cast(baseOffset()) > std::numeric_limits::max() - static_cast(offset)) || (static_cast(baseOffset() + offset) > std::numeric_limits::max() - reinterpret_cast(pData_))) { - throw Error(kerArithmeticOverflow); + throw Error(kerCorruptedMetadata); // #562 don't throw kerArithmeticOverflow } if (pData_ + static_cast(baseOffset()) + static_cast(offset) > pLast_) { throw Error(kerCorruptedMetadata);