From b9e6a2972f5a03e42b1524002f89dfd32829ce5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sat, 9 Sep 2017 14:13:38 +0200 Subject: [PATCH] fix address calculations --- bigtiff/parse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigtiff/parse.cpp b/bigtiff/parse.cpp index 426b200e..53b47c72 100644 --- a/bigtiff/parse.cpp +++ b/bigtiff/parse.cpp @@ -279,7 +279,7 @@ void printIFD(Exiv2::BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption bFirst = false; field_t field; - io.read(reinterpret_cast(&field), sizeof(field)); + io.read(reinterpret_cast(&field), sizeof(field_t)); const uint16_t tag = conditional_byte_swap<16>(field.tagID, bSwap); const uint16_t type = conditional_byte_swap<16>(field.tagType, bSwap); const uint64_t count = conditional_byte_swap<64>(field.count, bSwap); @@ -315,7 +315,7 @@ void printIFD(Exiv2::BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption if ( bPrint ) { - uint64_t address = offset + 2 + i*12 ; + const uint64_t address = offset + 2 + i * sizeof(field_t) ; out << indent(depth) << Exiv2::Internal::stringFormat("%8u | %#06x %-25s |%10s |%9u |%10u | " ,address,tag,tagName(tag,25),typeName(type),count,offset);