summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2013-10-15 13:46:29 -0700
committerYaowu Xu <yaowu@google.com>2013-10-29 10:28:25 -0700
commitcd4bac30046f8a756c33e50888f9806dea8f4cdc (patch)
tree5a4237c383e6e3ad9a99cb10c74d1d80ed347bd7
parent2f4a2a12681a8f9b7685ecd8377bc3954e662959 (diff)
downloadlibvpx-cd4bac30046f8a756c33e50888f9806dea8f4cdc.tar.gz
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
-rw-r--r--vp9/vp9_dx_iface.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c
index 10b32385c..a70cdceed 100644
--- a/vp9/vp9_dx_iface.c
+++ b/vp9/vp9_dx_iface.c
@@ -655,8 +655,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;