[FFmpeg-cvslog] v410dec: Check for sufficient input data.

Michael Niedermayer git at videolan.org
Wed Dec 28 19:21:51 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Dec 28 18:33:29 2011 +0100| [11ca3416f92744f376c08e5f31bcbe5d9b44acb2] | committer: Michael Niedermayer

v410dec: Check for sufficient input data.
Fixes crash

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

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

 libavcodec/v410dec.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c
index d746dd0..dfd1273 100644
--- a/libavcodec/v410dec.c
+++ b/libavcodec/v410dec.c
@@ -55,6 +55,11 @@ static int v410_decode_frame(AVCodecContext *avctx, void *data,
     if (pic->data[0])
         avctx->release_buffer(avctx, pic);
 
+    if (avpkt->size < 4*avctx->height*avctx->width) {
+        av_log(avctx, AV_LOG_ERROR, "Insufficient input data.\n");
+        return AVERROR(EINVAL);
+    }
+
     pic->reference = 0;
 
     if (avctx->get_buffer(avctx, pic) < 0) {



More information about the ffmpeg-cvslog mailing list