From 9fd8b40a4ed99eb011e353c112cbb7703a460e46 Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Thu, 5 Aug 2021 16:46:40 +0100 Subject: [PATCH] Replace assertion with an error message. (cherry picked from commit cb32b809c80163c2392543dfb830dffe44e47f91) --- src/tiffcomposite_int.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tiffcomposite_int.cpp b/src/tiffcomposite_int.cpp index 6da7a964..8890ec47 100644 --- a/src/tiffcomposite_int.cpp +++ b/src/tiffcomposite_int.cpp @@ -1207,7 +1207,12 @@ namespace Exiv2 { valueIdx, dataIdx, imageIdx); - assert(len <= 4); +#ifndef SUPPRESS_WARNINGS + if (len > 4) { + EXV_ERROR << "Unexpected length in TiffDirectory::writeDirEntry(): len == " + << len << ".\n"; + } +#endif if (len < 4) { memset(buf, 0x0, 4); ioWrapper.write(buf, 4 - len);