[FFmpeg-cvslog] msmpeg4dec: check w/h, prevent assert failure later

Michael Niedermayer git at videolan.org
Sun Nov 11 18:56:55 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Nov 11 18:45:56 2012 +0100| [b7b7e2348c07498f373d3b14a13615de151b2e7e] | committer: Michael Niedermayer

msmpeg4dec: check w/h, prevent assert failure later

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/msmpeg4.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index 7988e1f..39305f7 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -593,6 +593,11 @@ av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx)
     int i;
     MVTable *mv;
 
+    if(avctx->width<=0 || avctx->height<=0) {
+        av_log(avctx, AV_LOG_ERROR, "invalid dimensions\n");
+        return -1;
+    }
+
     if (ff_h263_decode_init(avctx) < 0)
         return -1;
 



More information about the ffmpeg-cvslog mailing list