From e4f56843ea04aae0bbb8242b2be1ea228a5ab3a8 Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Wed, 30 Jun 2021 12:11:34 +0100 Subject: [PATCH] Defensive coding to avoid 0x80000000/0xFFFFFFFF FPE. --- src/tags_int.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tags_int.cpp b/src/tags_int.cpp index 492f199096..c98ab94fbb 100644 --- a/src/tags_int.cpp +++ b/src/tags_int.cpp @@ -2633,7 +2633,7 @@ namespace Exiv2 { Rational deg = value.toRational(0); Rational min = value.toRational(1); Rational sec = value.toRational(2); - if ((deg.second != 1) || (min.second == 0) || (sec.second == 0)) { + if ((deg.second != 1) || (min.second <= 0) || (sec.second <= 0)) { return os << "(" << value << ")"; } const int32_t dd = deg.first;