diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index fe96440fce..20c21263b5 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -137,6 +137,9 @@ static int raw_decode(AVCodecContext *avctx, buf= dst; } + if(avctx->codec_tag == MKTAG('A', 'V', '1', 'x')) + buf += buf_size - context->length; + if(buf_size < context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? 256*4 : 0)) return -1;