Skip to content

Commit

Permalink
fix integer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 30, 2023
1 parent 30d9ead commit c431edb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libheif/box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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};
}
Expand All @@ -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};
}
Expand Down

0 comments on commit c431edb

Please sign in to comment.