[FFmpeg-cvslog] bmv_videodec: fix out of array read

Michael Niedermayer git at videolan.org
Sat Sep 15 01:57:30 CEST 2012


ffmpeg | branch: release/0.11 | Michael Niedermayer <michaelni at gmx.at> | Tue Aug 14 18:58:49 2012 +0200| [d721cb009d73662f35c629bdc678e25786e79301] | committer: Michael Niedermayer

bmv_videodec: fix out of array read

Fixes Ticket1373

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 70f0ffa1ed456fd0b560d0dd1d0d93f1ba3a6d93)

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

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

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

diff --git a/libavcodec/bmv.c b/libavcodec/bmv.c
index 35923a2..d2f4e9f 100644
--- a/libavcodec/bmv.c
+++ b/libavcodec/bmv.c
@@ -268,6 +268,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
     c->avctx = avctx;
     avctx->pix_fmt = PIX_FMT_PAL8;
 
+    if (avctx->width != SCREEN_WIDE || avctx->height != SCREEN_HIGH) {
+        av_log(avctx, AV_LOG_ERROR, "Invalid dimension %dx%d\n", avctx->width, avctx->height);
+        return AVERROR_INVALIDDATA;
+    }
+
     c->pic.reference = 1;
     if (avctx->get_buffer(avctx, &c->pic) < 0) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");



More information about the ffmpeg-cvslog mailing list