diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-02 06:06:16 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 22:49:18 +0400 |
commit | 9c13d232a4ba858b3082127d9b332f0dd5595ace (patch) | |
tree | 7ba7745a351c05d5d263bb174230bd5490768524 | |
parent | c4926cba15d395bb1cb15c5985d10e81c9a6fa14 (diff) |
bmv: fix apparent sign error in the frame_off check
Fixes part of Ticket1373
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit debbcfae6010f027a0334d70d0dbb7ddd912ad5a)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/bmv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/bmv.c b/libavcodec/bmv.c index 9740b11f15..35923a28d6 100644 --- a/libavcodec/bmv.c +++ b/libavcodec/bmv.c @@ -143,7 +143,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame, switch (mode) { case 1: if (forward) { - if (dst - frame + SCREEN_WIDE < frame_off || + if (dst - frame + SCREEN_WIDE < -frame_off || frame_end - dst < frame_off + len) return -1; for (i = 0; i < len; i++) @@ -151,7 +151,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame, dst += len; } else { dst -= len; - if (dst - frame + SCREEN_WIDE < frame_off || + if (dst - frame + SCREEN_WIDE < -frame_off || frame_end - dst < frame_off + len) return -1; for (i = len - 1; i >= 0; i--) |