Skip to content

Commit

Permalink
opj_int_ceildiv(): fix int32 overflow. Fixes https://bugs.chromium.or…
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jul 28, 2017
1 parent 361c450 commit d6654d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/openjp2/opj_intmath.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Divide an integer and round upwards
static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b)
{
assert(b);
return (a + b - 1) / b;
return (OPJ_INT32)(((OPJ_INT64)a + b - 1) / b);
}

/**
Expand Down

0 comments on commit d6654d9

Please sign in to comment.