shithub: libvpx

Download patch

ref: c6e9eb69352e43d8241cdbde212a6280065aa891
parent: 49b27a87f5a3b4d9fa5d7fedd25004b127c27dd9
parent: 8f4b357d99cc3c1698a9a717a2bc78fa0cd6e9a1
author: Jim Bankoski <jimbankoski@google.com>
date: Thu Aug 21 02:58:42 EDT 2014

Merge "vp9_pickmode.c: check value that can be null to avoid warning"

--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -254,7 +254,8 @@
 }
 
 static void free_pred_buffer(PRED_BUFFER *p) {
-  p->in_use = 0;
+  if (p != NULL)
+    p->in_use = 0;
 }
 
 static void encode_breakout_test(VP9_COMP *cpi, MACROBLOCK *x,
@@ -671,8 +672,7 @@
         skip_txfm = x->skip_txfm[0];
 
         if (cpi->sf.reuse_inter_pred_sby) {
-          if (best_pred != NULL)
-            free_pred_buffer(best_pred);
+          free_pred_buffer(best_pred);
 
           best_pred = this_mode_pred;
         }
@@ -692,7 +692,8 @@
 
   // If best prediction is not in dst buf, then copy the prediction block from
   // temp buf to dst buf.
-  if (cpi->sf.reuse_inter_pred_sby && best_pred->data != orig_dst.buf) {
+  if (best_pred != NULL && cpi->sf.reuse_inter_pred_sby &&
+      best_pred->data != orig_dst.buf) {
     uint8_t *copy_from, *copy_to;
 
     pd->dst = orig_dst;