summaryrefslogtreecommitdiff
path: root/vp9/decoder/vp9_decodframe.c
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2013-10-15 11:05:06 -0700
committerYaowu Xu <yaowu@google.com>2013-10-15 13:55:25 -0700
commit52a39f75f25e3c596b39ceff4d07c22c58d90c18 (patch)
tree99a264833c40fb095b6afba5ad7c8dded579d74b /vp9/decoder/vp9_decodframe.c
parentff1083c11343da3e87602c3940afa523abd7266a (diff)
downloadlibvpx-52a39f75f25e3c596b39ceff4d07c22c58d90c18.tar
libvpx-52a39f75f25e3c596b39ceff4d07c22c58d90c18.tar.gz
libvpx-52a39f75f25e3c596b39ceff4d07c22c58d90c18.tar.bz2
libvpx-52a39f75f25e3c596b39ceff4d07c22c58d90c18.zip
Added trap for invalid key frame
Change-Id: I698e8df9b336d38bffe01e656acba00d4003695f
Diffstat (limited to 'vp9/decoder/vp9_decodframe.c')
-rw-r--r--vp9/decoder/vp9_decodframe.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c
index cc3422f97..acde390f2 100644
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -955,9 +955,15 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
YV12_BUFFER_CONFIG *new_fb = &cm->yv12_fb[cm->new_fb_idx];
if (!first_partition_size) {
- // showing a frame directly
- *p_data_end = data + 1;
- return 0;
+ if (!keyframe) {
+ // showing a frame directly
+ *p_data_end = data + 1;
+ return 0;
+ } else {
+ vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,
+ "Invalid key frame");
+ return -1;
+ }
}
data += vp9_rb_bytes_read(&rb);
xd->corrupted = 0;