From 1429ae843a8fdf5d28824cc27f57b4e9ad7e52fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sat, 9 Sep 2017 14:39:04 +0200 Subject: [PATCH] fix memcpy bytes size --- bigtiff/parse.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bigtiff/parse.cpp b/bigtiff/parse.cpp index 5e46cd7b..10417114 100644 --- a/bigtiff/parse.cpp +++ b/bigtiff/parse.cpp @@ -300,18 +300,18 @@ void printIFD(Exiv2::BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption : is8ByteType(type) ? 8 : 1; - Exiv2::DataBuf buf(size*count + pad); // allocate a buffer + Exiv2::DataBuf buf(size * count + pad); // big data? Use 'data' as pointer to real data if ( count*size > 8 ) // read into buffer { size_t restore = io.tell(); // save io.seek(data, Exiv2::BasicIo::beg); // position - io.read(buf.pData_,count*size); // read + io.read(buf.pData_, count * size); // read io.seek(restore, Exiv2::BasicIo::beg); // restore } else // use 'data' as data :) - std::memcpy(buf.pData_, &data, 8); // copy data + std::memcpy(buf.pData_, &data, count * size); // copy data if ( bPrint ) {