shithub: libvpx

Download patch

ref: 7997c68ed43634606985a255d28fc4a9879a5f27
parent: fdc977afc6b431c7577e70d151f89ea726bcaf8f
author: James Zern <jzern@google.com>
date: Wed Feb 17 07:36:49 EST 2016

vp9_cyclic_refresh_alloc: correct cleanup on error

previously only the CYCLIC_REFRESH allocation was being freed

Change-Id: I6e1783d077c5ca83c8d62ea9642f1fb03f2e5bf3

--- a/vp9/encoder/vp9_aq_cyclicrefresh.c
+++ b/vp9/encoder/vp9_aq_cyclicrefresh.c
@@ -30,13 +30,13 @@
 
   cr->map = vpx_calloc(mi_rows * mi_cols, sizeof(*cr->map));
   if (cr->map == NULL) {
-    vpx_free(cr);
+    vp9_cyclic_refresh_free(cr);
     return NULL;
   }
   last_coded_q_map_size = mi_rows * mi_cols * sizeof(*cr->last_coded_q_map);
   cr->last_coded_q_map = vpx_malloc(last_coded_q_map_size);
   if (cr->last_coded_q_map == NULL) {
-    vpx_free(cr);
+    vp9_cyclic_refresh_free(cr);
     return NULL;
   }
   assert(MAXQ <= 255);
@@ -45,7 +45,7 @@
   consec_zero_mv_size = mi_rows * mi_cols * sizeof(*cr->consec_zero_mv);
   cr->consec_zero_mv = vpx_malloc(consec_zero_mv_size);
   if (cr->consec_zero_mv == NULL) {
-    vpx_free(cr);
+    vp9_cyclic_refresh_free(cr);
     return NULL;
   }
   memset(cr->consec_zero_mv, 0, consec_zero_mv_size);