diff --git a/libavcodec/pdvdec.c b/libavcodec/pdvdec.c index e2c03e7e0d..dae9f63cc5 100644 --- a/libavcodec/pdvdec.c +++ b/libavcodec/pdvdec.c @@ -75,6 +75,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, return AVERROR_INVALIDDATA; } + if (avpkt->size * 1032LL < ((avctx->width + 7) >> 3) * avctx->height) //Asymptotic max compression of deflate + return AVERROR_INVALIDDATA; + if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) return ret;