Commit 8f521690 authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Ronald S. Bultje

v410dec: Check for sufficient input data. Fixes crash

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
Signed-off-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
parent 733b23c2
...@@ -55,6 +55,11 @@ static int v410_decode_frame(AVCodecContext *avctx, void *data, ...@@ -55,6 +55,11 @@ static int v410_decode_frame(AVCodecContext *avctx, void *data,
if (pic->data[0]) if (pic->data[0])
avctx->release_buffer(avctx, pic); 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; pic->reference = 0;
if (avctx->get_buffer(avctx, pic) < 0) { if (avctx->get_buffer(avctx, pic) < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment