[FFmpeg-cvslog] ff_mss12_decode_init: check dimensions

Michael Niedermayer git at videolan.org
Thu Jan 24 01:49:53 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan 24 01:25:02 2013 +0100| [ee9151b616fa7fa5e9b3258ecafd00c9f784baaa] | committer: Michael Niedermayer

ff_mss12_decode_init: check dimensions

Fixes assertion failure

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=ee9151b616fa7fa5e9b3258ecafd00c9f784baaa
---

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

diff --git a/libavcodec/mss12.c b/libavcodec/mss12.c
index 59294b8..b522e4a 100644
--- a/libavcodec/mss12.c
+++ b/libavcodec/mss12.c
@@ -586,6 +586,11 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
                avctx->coded_width, avctx->coded_height);
         return AVERROR_INVALIDDATA;
     }
+    if (avctx->coded_width < 1 || avctx->coded_height < 1) {
+        av_log(avctx, AV_LOG_ERROR, "Frame dimensions %dx%d too small",
+               avctx->coded_width, avctx->coded_height);
+        return AVERROR_INVALIDDATA;
+    }
 
     av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d\n",
            AV_RB32(avctx->extradata + 4), AV_RB32(avctx->extradata + 8));



More information about the ffmpeg-cvslog mailing list