From 8f5216905f88510c9a74cd91a424902aa989b9a1 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 28 Dec 2011 15:04:44 -0500 Subject: v410dec: Check for sufficient input data. Fixes crash Signed-off-by: Michael Niedermayer Signed-off-by: Ronald S. Bultje --- libavcodec/v410dec.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavcodec/v410dec.c') diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c index 71cbe0b355..54c9595826 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) { -- cgit v1.2.3