summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorAdrian Grange <agrange@google.com>2014-02-24 10:15:21 -0800
committerAdrian Grange <agrange@google.com>2014-02-24 10:19:31 -0800
commit709fecac83c86de956befbfcc029da1dba332a6d (patch)
tree54f910e5ad50893a2839e28989e90543617f1005 /vp9
parentbfaf415ea7a90af4f093733d5e0a115f73d03930 (diff)
downloadlibvpx-709fecac83c86de956befbfcc029da1dba332a6d.tar
libvpx-709fecac83c86de956befbfcc029da1dba332a6d.tar.gz
libvpx-709fecac83c86de956befbfcc029da1dba332a6d.tar.bz2
libvpx-709fecac83c86de956befbfcc029da1dba332a6d.zip
Trap request to display non-existant frame
If show_existing_frame indicates that the decoder should display an existing (previously decoded) frame, add a check to make sure that the signaled buffer does contain a valid decoded frame. Change-Id: Iac8c686b321827414d69a3f2d0467566911bcba2
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 791d0f2e7..4f3aca1d2 100644
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -1120,6 +1120,12 @@ static size_t read_uncompressed_header(VP9D_COMP *pbi,
if (cm->show_existing_frame) {
// Show an existing frame directly.
const int frame_to_show = cm->ref_frame_map[vp9_rb_read_literal(rb, 3)];
+
+ if (cm->frame_bufs[frame_to_show].ref_count < 1)
+ vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM,
+ "Buffer %d does not contain a decoded frame",
+ frame_to_show);
+
ref_cnt_fb(cm->frame_bufs, &cm->new_fb_idx, frame_to_show);
pbi->refresh_frame_flags = 0;
cm->lf.filter_level = 0;