[FFmpeg-cvslog] avformat/mpc8: fix broken pointer math
wm4
git at videolan.org
Thu Mar 12 00:52:52 CET 2015
ffmpeg | branch: release/0.7 | wm4 <nfxjfg at googlemail.com> | Tue Feb 3 19:04:11 2015 +0100| [a58b8e99c4211c17361d0469ff522298cfb01344] | committer: Michael Niedermayer
avformat/mpc8: fix broken pointer math
This could overflow and crash at least on 32 bit systems.
Reviewed-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit b737a2c52857b214be246ff615c6293730033cfa)
Conflicts:
libavformat/mpc8.c
(cherry picked from commit 49dd89f9027f3def12e170bb7d986d37812eedba)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a58b8e99c4211c17361d0469ff522298cfb01344
---
libavformat/mpc8.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 161cee3..4d95a1d 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -88,7 +88,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)
More information about the ffmpeg-cvslog
mailing list