summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ffv1dec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index c7efd0bb45..d71584505d 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<<ff_log2_run[i]); i++)
+ w -= ff_log2_run[i];
+ if (buf_size < (avctx->height + i + 6)/ 8)
return AVERROR_INVALIDDATA;
}