From a71bb64fe959c0fe891de5cec99bb6ca44172818 Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Wed, 22 Sep 2021 23:55:15 +0100 Subject: [PATCH] Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39060 Fix UBSAN failure caused by left shift of a negative number. --- src/pentaxmn_int.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pentaxmn_int.cpp b/src/pentaxmn_int.cpp index f4cb3863..32d6f305 100644 --- a/src/pentaxmn_int.cpp +++ b/src/pentaxmn_int.cpp @@ -1036,7 +1036,7 @@ namespace Exiv2 { std::ostream& PentaxMakerNote::printDate(std::ostream& os, const Value& value, const ExifData*) { /* I choose same format as is used inside EXIF itself */ - os << ((value.toLong(0) << 8) + value.toLong(1)); + os << ((static_cast(value.toLong(0)) << 8) + value.toLong(1)); os << ":"; os << std::setw(2) << std::setfill('0') << value.toLong(2); os << ":";