diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c index 03b4df5a45cbbe9ac928409598f4573903bdf98c..614bf4bc0449ae668b77e00ad690c2808617b522 100644 --- a/vp9/decoder/vp9_decodeframe.c +++ b/vp9/decoder/vp9_decodeframe.c @@ -621,6 +621,11 @@ static void setup_display_size(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) { } static void resize_context_buffers(VP9_COMMON *cm, int width, int height) { +#if CONFIG_SIZE_LIMIT + if (width > DECODE_WIDTH_LIMIT || height > DECODE_HEIGHT_LIMIT) + vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, + "Width and height beyond allowed size."); +#endif if (cm->width != width || cm->height != height) { // Change in frame size (assumption: color format does not change). if (cm->width == 0 || cm->height == 0 ||