summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2013-03-04 11:10:06 -0800
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-03-04 11:10:06 -0800
commita5762191d7fae0e500a001ad1daf8eff39ae1d2e (patch)
treeef4b60d0ab0ba7906b7ed199a711c1f5d8420377 /vp8
parent08348d9cabf6e6aad1ae805ec58d6aacaa1b33ce (diff)
parent798c5b148d54bdb56d1d85015348d7d88e3394f8 (diff)
downloadlibvpx-a5762191d7fae0e500a001ad1daf8eff39ae1d2e.tar
libvpx-a5762191d7fae0e500a001ad1daf8eff39ae1d2e.tar.gz
libvpx-a5762191d7fae0e500a001ad1daf8eff39ae1d2e.tar.bz2
libvpx-a5762191d7fae0e500a001ad1daf8eff39ae1d2e.zip
Merge "vp8_init: fix NULL dereference on allocation error"
Diffstat (limited to 'vp8')
-rw-r--r--vp8/vp8_dx_iface.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/vp8/vp8_dx_iface.c b/vp8/vp8_dx_iface.c
index 1db61f161..7cda19d32 100644
--- a/vp8/vp8_dx_iface.c
+++ b/vp8/vp8_dx_iface.c
@@ -211,21 +211,19 @@ static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx,
mmap.flags = vp8_mem_req_segs[0].flags;
res = vp8_mmap_alloc(&mmap);
+ if (res != VPX_CODEC_OK) return res;
- if (!res)
- {
- vp8_init_ctx(ctx, &mmap);
+ vp8_init_ctx(ctx, &mmap);
- /* initialize number of fragments to zero */
- ctx->priv->alg_priv->fragments.count = 0;
- /* is input fragments enabled? */
- ctx->priv->alg_priv->fragments.enabled =
- (ctx->priv->alg_priv->base.init_flags &
- VPX_CODEC_USE_INPUT_FRAGMENTS);
+ /* initialize number of fragments to zero */
+ ctx->priv->alg_priv->fragments.count = 0;
+ /* is input fragments enabled? */
+ ctx->priv->alg_priv->fragments.enabled =
+ (ctx->priv->alg_priv->base.init_flags &
+ VPX_CODEC_USE_INPUT_FRAGMENTS);
- ctx->priv->alg_priv->defer_alloc = 1;
- /*post processing level initialized to do nothing */
- }
+ ctx->priv->alg_priv->defer_alloc = 1;
+ /*post processing level initialized to do nothing */
}
ctx->priv->alg_priv->yv12_frame_buffers.use_frame_threads =