diff --git a/libheif/box.cc b/libheif/box.cc index 4c0a85afe4..e752ac4807 100644 --- a/libheif/box.cc +++ b/libheif/box.cc @@ -85,7 +85,7 @@ Fraction::Fraction(int64_t num, int64_t den) Fraction Fraction::operator+(const Fraction& b) const { if (denominator == b.denominator) { - int64_t n = numerator + b.numerator; + int64_t n = int64_t{numerator} + b.numerator; int64_t d = denominator; return Fraction{n,d}; } @@ -99,7 +99,7 @@ Fraction Fraction::operator+(const Fraction& b) const Fraction Fraction::operator-(const Fraction& b) const { if (denominator == b.denominator) { - int64_t n = numerator - b.numerator; + int64_t n = int64_t{numerator} - b.numerator; int64_t d = denominator; return Fraction{n,d}; }