diff options
author | Alexander Voronov <avoronov@graphics.cs.msu.ru> | 2014-12-11 20:44:19 +0300 |
---|---|---|
committer | Alexander Voronov <avoronov@graphics.cs.msu.ru> | 2014-12-11 20:44:19 +0300 |
commit | 6c6a97814ff5b7707fadaccc445615f91a07ebf7 (patch) | |
tree | ab9b29d6a09de52c982c4e84492958bd99428f98 /vp9/decoder/vp9_decodeframe.c | |
parent | 26a0721268cfbb921f8b2320ccecab2c3d8982f2 (diff) | |
download | libvpx-6c6a97814ff5b7707fadaccc445615f91a07ebf7.tar libvpx-6c6a97814ff5b7707fadaccc445615f91a07ebf7.tar.gz libvpx-6c6a97814ff5b7707fadaccc445615f91a07ebf7.tar.bz2 libvpx-6c6a97814ff5b7707fadaccc445615f91a07ebf7.zip |
Prevent decoder from using uninitialized entropy context.
If decoding starts with intra-only frame, there is a possibility
of using uninitialized entropy context, what leads to undefined
behavior.
Change-Id: Icbb64b5b1bd1e5de2a4bfa2884e56bc0a20840af
Diffstat (limited to 'vp9/decoder/vp9_decodeframe.c')
-rw-r--r-- | vp9/decoder/vp9_decodeframe.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c index 2c5fbacb9..470b2bae8 100644 --- a/vp9/decoder/vp9_decodeframe.c +++ b/vp9/decoder/vp9_decodeframe.c @@ -1558,6 +1558,10 @@ void vp9_decode_frame(VP9Decoder *pbi, vp9_setup_block_planes(xd, cm->subsampling_x, cm->subsampling_y); *cm->fc = cm->frame_contexts[cm->frame_context_idx]; + if (!cm->fc->initialized) + vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, + "Uninitialized entropy context."); + vp9_zero(cm->counts); vp9_zero(xd->dqcoeff); |