From ff21b5a9626546cb09a14a4ca1122d0bb8c6216c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sun, 17 Sep 2017 18:17:03 +0200 Subject: [PATCH] restore position if necessary --- src/bigtiffimage.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bigtiffimage.cpp b/src/bigtiffimage.cpp index 709bb34d..76336638 100644 --- a/src/bigtiffimage.cpp +++ b/src/bigtiffimage.cpp @@ -396,11 +396,16 @@ namespace Exiv2 return Image::AutoPtr(new BigTiffImage(io)); } - bool isBigTiffType(BasicIo& io, bool) + bool isBigTiffType(BasicIo& io, bool advance) { + const long pos = io.tell(); const Header header = readHeader(io); + const bool valid = header.isValid(); - return header.isValid(); + if (valid == false || advance == false) + io.seek(pos, BasicIo::beg); + + return valid; } }