Only touch ctx->priv if vp8_mmap_alloc succeeded.
authorFredrik Söderquist <fs@opera.com>
Mon, 7 Jun 2010 16:20:47 +0000 (18:20 +0200)
committerJohn Koleszar <jkoleszar@google.com>
Fri, 23 Jul 2010 23:13:34 +0000 (19:13 -0400)
vp8/vp8_dx_iface.c

index e0e1103..36a0b39 100644 (file)
@@ -223,11 +223,12 @@ static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx)
         res = vp8_mmap_alloc(&mmap);
 
         if (!res)
+        {
             vp8_init_ctx(ctx, &mmap);
 
-        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 */
+        }
     }
 
     return res;