shithub: libvpx

Download patch

ref: f480c1256d21c5dafcfb124bc6bdff36dc0aef41
parent: 65b768fdf9e7dd0402beedd2513cc1e590c7443e
author: Adrian Grange <agrange@google.com>
date: Thu May 14 11:44:50 EDT 2015

Fix illegal memory access when stream starts w/ invisible frame.

Add a check to make sure we have a decoded frame available
before copying its 'corrupt' flag.

(Originally submitted to the old repository by Alexander Voronov
as: https://gerrit.chromium.org/gerrit/#/c/74305/).

Change-Id: Iceb4686c785afb437b668015bf8818b18d60e0ce

--- a/vp9/vp9_dx_iface.c
+++ b/vp9/vp9_dx_iface.c
@@ -937,7 +937,8 @@
           frame_worker_data->pbi->common.buffer_pool->frame_bufs;
       if (frame_worker_data->pbi->common.frame_to_show == NULL)
         return VPX_CODEC_ERROR;
-      *corrupted = frame_bufs[ctx->last_show_frame].buf.corrupted;
+      if (ctx->last_show_frame >= 0)
+        *corrupted = frame_bufs[ctx->last_show_frame].buf.corrupted;
       return VPX_CODEC_OK;
     } else {
       return VPX_CODEC_ERROR;