aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-28 18:33:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 22:38:16 +0100
commita47c2772055b7d6195a245636aecd67d7e81a104 (patch)
tree281b4004aa5e3e7b5048c965f73bf733554104cf
parentb0355d3253d89f7e373277b58da7803d3a45ab90 (diff)
downloadffmpeg-a47c2772055b7d6195a245636aecd67d7e81a104.tar.gz
v410dec: Check for sufficient input data.
Fixes crash Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 11ca3416f92744f376c08e5f31bcbe5d9b44acb2) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/v410dec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c
index 6640ba0345..c86009d31a 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) {