aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2015-02-03 19:04:11 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-12 18:03:49 +0100
commite83c03aaf1477b9985c80669f824ef0534002a4e (patch)
tree8f19893dc7911c2d1c0ee0c07f982139adbe1ba2
parent376533e0cd86e40a8d452b4a040560ab4758241d (diff)
downloadffmpeg-e83c03aaf1477b9985c80669f824ef0534002a4e.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) Conflicts: libavformat/mpc8.c (cherry picked from commit 49dd89f9027f3def12e170bb7d986d37812eedba) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mpc8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index b448c1b8ca..6499fca79e 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -89,7 +89,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_MAX / 4 - 1; //seems to be valid MPC but no header yet
if (header_found) {
if (size < 11 || size > 28)