diff options
author | Yaowu Xu <yaowu@google.com> | 2013-10-15 13:46:29 -0700 |
---|---|---|
committer | Yaowu Xu <yaowu@google.com> | 2013-10-15 13:51:42 -0700 |
commit | ff1083c11343da3e87602c3940afa523abd7266a (patch) | |
tree | 7c76a6187bc4fd82cac6ff72ab9d4b032796126b /vp9 | |
parent | 45dbe94ee01491444a1001c62e1d27981bed51f3 (diff) | |
download | libvpx-ff1083c11343da3e87602c3940afa523abd7266a.tar libvpx-ff1083c11343da3e87602c3940afa523abd7266a.tar.gz libvpx-ff1083c11343da3e87602c3940afa523abd7266a.tar.bz2 libvpx-ff1083c11343da3e87602c3940afa523abd7266a.zip |
Prevent access to invalid pointer
The commit added check to make sure no invalid memory access even when
the decoder instance is never initialized.
Change-Id: I4da343d0b3c78c27777ac7f5ce7688562c69f0c5
Diffstat (limited to 'vp9')
-rw-r--r-- | vp9/vp9_dx_iface.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c index 7a5b78634..6b923162f 100644 --- a/vp9/vp9_dx_iface.c +++ b/vp9/vp9_dx_iface.c @@ -658,8 +658,10 @@ static vpx_codec_err_t get_frame_corrupted(vpx_codec_alg_priv_t *ctx, if (corrupted) { VP9D_COMP *pbi = (VP9D_COMP *)ctx->pbi; - *corrupted = pbi->common.frame_to_show->corrupted; - + if (pbi) + *corrupted = pbi->common.frame_to_show->corrupted; + else + return VPX_CODEC_ERROR; return VPX_CODEC_OK; } else { return VPX_CODEC_INVALID_PARAM; |