summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorJim Bankoski <jimbankoski@google.com>2014-07-01 16:48:45 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-07-01 16:48:45 -0700
commit56dbf1ca6c7031aefef69d3493ac97b1f09f8c6f (patch)
treefed9d9eae528c7a7b548ada70243154bf9067ba0 /vp9
parent64742f825d1e17a33ed412001414848789258e03 (diff)
parentabf0df08f167324b9c47c77465b1f3e6ee2ce067 (diff)
downloadlibvpx-56dbf1ca6c7031aefef69d3493ac97b1f09f8c6f.tar
libvpx-56dbf1ca6c7031aefef69d3493ac97b1f09f8c6f.tar.gz
libvpx-56dbf1ca6c7031aefef69d3493ac97b1f09f8c6f.tar.bz2
libvpx-56dbf1ca6c7031aefef69d3493ac97b1f09f8c6f.zip
Merge "validate uv block size when reading partition"
Diffstat (limited to 'vp9')
-rw-r--r--vp9/decoder/vp9_decodeframe.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c
index 404a34525..8efae959a 100644
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -410,13 +410,17 @@ static void decode_partition(VP9_COMMON *const cm, MACROBLOCKD *const xd,
vp9_reader* r, BLOCK_SIZE bsize) {
const int hbs = num_8x8_blocks_wide_lookup[bsize] / 2;
PARTITION_TYPE partition;
- BLOCK_SIZE subsize;
+ BLOCK_SIZE subsize, uv_subsize;
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
return;
partition = read_partition(cm, xd, hbs, mi_row, mi_col, bsize, r);
subsize = get_subsize(bsize, partition);
+ uv_subsize = ss_size_lookup[subsize][cm->subsampling_x][cm->subsampling_y];
+ if (subsize >= BLOCK_8X8 && uv_subsize == BLOCK_INVALID)
+ vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,
+ "Invalid block size.");
if (subsize < BLOCK_8X8) {
decode_block(cm, xd, tile, mi_row, mi_col, r, subsize);
} else {