shithub: libvpx

Download patch

ref: caba78ef49e8cc2250ea79c2d21e5e3710354199
parent: d1ad3b678b5b5542122340d4b5db33c95fc1f858
author: Deb Mukherjee <debargha@google.com>
date: Thu May 22 21:26:01 EDT 2014

Fixes a bug for uninitialized frame buffers

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

--- a/vp8/vp8_dx_iface.c
+++ b/vp8/vp8_dx_iface.c
@@ -386,8 +386,10 @@
     /* 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)
     {