]> granicus.if.org Git - libvpx/commitdiff
Fixes a bug for uninitialized frame buffers
authorDeb Mukherjee <debargha@google.com>
Fri, 23 May 2014 08:26:01 +0000 (01:26 -0700)
committerDeb Mukherjee <debargha@google.com>
Fri, 23 May 2014 08:26:01 +0000 (01:26 -0700)
Fixes a bug introduced in
https://gerrit.chromium.org/gerrit/#/c/69779/13, where
uninitialized frame buffers due to corrupt and short
buffer sizes, may cause a crash.

This patch fixes the currently failing
video/processing/static_image/vp8_convert_test

Change-Id: I1b09e21482f292c11a2bfb4e570aef1d643410a7

vp8/vp8_dx_iface.c

index 10cbc6a583a3ad0d6a2bcc50016fc038770743fc..d6dfb1643b1856255ce9a51529560778e0976b0a 100644 (file)
@@ -386,8 +386,10 @@ static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t  *ctx,
     /* Set these even if already initialized.  The caller may have changed the
      * decrypt config between frames.
      */
-    ctx->yv12_frame_buffers.pbi[0]->decrypt_cb = ctx->decrypt_cb;
-    ctx->yv12_frame_buffers.pbi[0]->decrypt_state = ctx->decrypt_state;
+    if (ctx->decoder_init) {
+      ctx->yv12_frame_buffers.pbi[0]->decrypt_cb = ctx->decrypt_cb;
+      ctx->yv12_frame_buffers.pbi[0]->decrypt_state = ctx->decrypt_state;
+    }
 
     if (!res)
     {