summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorJim Bankoski <jimbankoski@google.com>2014-07-17 06:31:50 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-07-17 07:07:48 -0700
commit943e43273b0a7369d07714e7fd2e19fecfb11c7c (patch)
treea503ecd8b32bff01dcb767e87db4d94685681b3a /vp9
parent1a01194ab548ca9b5d7dbbdc2350d4c06f54e6d4 (diff)
downloadlibvpx-943e43273b0a7369d07714e7fd2e19fecfb11c7c.tar
libvpx-943e43273b0a7369d07714e7fd2e19fecfb11c7c.tar.gz
libvpx-943e43273b0a7369d07714e7fd2e19fecfb11c7c.tar.bz2
libvpx-943e43273b0a7369d07714e7fd2e19fecfb11c7c.zip
allow config options to limit max size of decode
This is a practical concern to allow us to fail in a decoder instance if the size of a file is bigger than we can reasonably handle. Change-Id: I0446b5502b1f8a48408107648ff2a8d187dca393
Diffstat (limited to 'vp9')
-rw-r--r--vp9/decoder/vp9_decodeframe.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c
index 82d0307e0..615fa4c76 100644
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -621,6 +621,12 @@ static void setup_display_size(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) {
}
static void apply_frame_size(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.
// TODO(agrange) Don't test width/height, check overall size.