[FFmpeg-cvslog] avformat/mpegvideodec: fix hypothetical pointer overflow in mpegvideo_probe()

Michael Niedermayer git at videolan.org
Sun Mar 15 13:55:15 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Mar 15 13:39:56 2015 +0100| [32c4b504b4ba16ef05ab474541150c39f758746c] | committer: Michael Niedermayer

avformat/mpegvideodec: fix hypothetical pointer overflow in mpegvideo_probe()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=32c4b504b4ba16ef05ab474541150c39f758746c
---

 libavformat/mpegvideodec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpegvideodec.c b/libavformat/mpegvideodec.c
index 5ea5569..aca9621 100644
--- a/libavformat/mpegvideodec.c
+++ b/libavformat/mpegvideodec.c
@@ -52,11 +52,11 @@ static int mpegvideo_probe(AVProbeData *p)
                 j = -1;
                 if (ptr[j + 8] & 2)
                     j+= 64;
-                if (ptr + j >= end)
+                if (j >= end - ptr)
                     break;
                 if (ptr[j + 8] & 1)
                     j+= 64;
-                if (ptr + j >= end)
+                if (j >= end - ptr)
                     break;
                 if (AV_RB24(ptr + j + 9) & 0xFFFFFE)
                     break;



More information about the ffmpeg-cvslog mailing list