diff options
author | wm4 <nfxjfg@googlemail.com> | 2015-02-03 19:04:11 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-13 20:48:08 +0100 |
commit | 600c6ebc7d0409f244c8b6e7b424f9c3d60ca493 (patch) | |
tree | 5e22ac5035807536e2f7a38599690c21e8d98599 | |
parent | 2515de3b1534ac92762e39d914fcad557860d3d8 (diff) | |
download | ffmpeg-600c6ebc7d0409f244c8b6e7b424f9c3d60ca493.tar.gz |
avformat/mpc8: fix broken pointer math
This could overflow and crash at least on 32 bit systems.
Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b737a2c52857b214be246ff615c6293730033cfa)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/mpc8.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c index 722d0ee05f..6524c7e489 100644 --- a/libavformat/mpc8.c +++ b/libavformat/mpc8.c @@ -91,7 +91,7 @@ static int mpc8_probe(AVProbeData *p) size = bs_get_v(&bs); if (size < 2) return 0; - if (bs + size - 2 >= bs_end) + if (size >= bs_end - bs + 2) return AVPROBE_SCORE_EXTENSION - 1; // seems to be valid MPC but no header yet if (header_found) { if (size < 11 || size > 28) |