diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 01ddcaa512..fd8088f16c 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -883,7 +883,10 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, if (buf_size < avctx->width * avctx->height / (128*8)) return AVERROR_INVALIDDATA; } else { - if (buf_size < avctx->height / 8) + int w = avctx->width; + for (int i = 0; w > (1<height + i + 6)/ 8) return AVERROR_INVALIDDATA; }