From a558a1d066a70e23f4bc96cca1c80ca58646eec8 Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Thu, 17 Nov 2011 07:20:52 +0000 Subject: [PATCH] #797: Truncate entries with an out-of-bounds upper boundary, rather than trying to adjust their size. --- src/tiffvisitor.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp index b89e0cdd..0a9e6d68 100644 --- a/src/tiffvisitor.cpp +++ b/src/tiffvisitor.cpp @@ -1523,10 +1523,9 @@ namespace Exiv2 { << ", exceeds buffer size by " // cast to make MSVC happy << static_cast(pData + size - pLast_) - << " Bytes; adjusting the size\n"; + << " Bytes; truncating the entry\n"; #endif - size = static_cast(pLast_ - pData); - // Todo: adjust count, make size a multiple of typeSize + size = 0; } } Value::AutoPtr v = Value::create(typeId);