From 7d9ed33bde3e7e638d413ddc2eaaf304282b167c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 30 Aug 2018 00:25:12 +0200 Subject: [PATCH] Initialize DataBuf with 0s => fix valgrind error --- src/image.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/image.cpp b/src/image.cpp index 5277c58e..706a9532 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -404,6 +404,7 @@ namespace Exiv2 { throw Error(kerInvalidMalloc); } DataBuf buf((long)allocate); // allocate a buffer + std::memset(buf.pData_, 0, buf.size_); std::memcpy(buf.pData_,dir.pData_+8,4); // copy dir[8:11] into buffer (short strings) const bool bOffsetIsPointer = count*size > 4;