mirror of https://github.com/FFmpeg/FFmpeg.git
The check "left >= INT_MAX - right" is supposed to check for whether left + right does not overflow/wraparound, but given that left and top are uint32_t INT_MAX - right can already wraparound for big values of right (and ordinary 32-bit ints): If right == UINT32_MAX, INT_MAX - right is INT_MAX + 1; for left in 0..par->width both checks will be passed. Fix this and simplify the check by using 64-bit types, where the addition is guaranteed not to overflow. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>release/7.1
parent
8765b36a52
commit
9ffac78eba
1 changed files with 2 additions and 4 deletions
Loading…
Reference in new issue