Fix UBSAN failure caused by left shift of a negative number.
main
Kevin Backhouse 4 years ago
parent 90434bbe2f
commit a71bb64fe9
No known key found for this signature in database
GPG Key ID: 9DD01852EE40366E

@ -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<uint64_t>(value.toLong(0)) << 8) + value.toLong(1));
os << ":";
os << std::setw(2) << std::setfill('0') << value.toLong(2);
os << ":";

Loading…
Cancel
Save