diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 48ae1e8041..fc285cadf5 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2896,6 +2896,8 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb) if (av_image_check_size(visible_width, visible_height, 0, avctx) < 0 || visible_width + offset_x > s->width || visible_height + offset_y > s->height || + visible_width + 512 < s->width || + visible_height + 512 < s->height || visible_width < 18 ) { av_log(avctx, AV_LOG_ERROR,