shithub: libvpx

Download patch

ref: 4eee74d6ed74a29bfd03c5d79bae2ab157944137
parent: 5810f1b4cdc4d15724d4d34b5498fa96ac5c0412
author: hkuang <hkuang@google.com>
date: Tue Dec 9 09:32:48 EST 2014

Fix clang ioc warning due to NULL src_mi pointer.

The warning only happens in VP9 encoder's first pass due to src_mi
is not set up yet. But it will not fail the encoder as left_mi and
above_mi are not used in the first_pass and they will be set up again
in the second pass.

Change-Id: I12dffcd5fb1002b2b2dabb083c8726650e4b5f08

--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -311,7 +311,7 @@
   xd->left_available  = (mi_col > tile->mi_col_start);
   if (xd->up_available) {
     xd->above_mi = xd->mi[-xd->mi_stride].src_mi;
-    xd->above_mbmi = &xd->above_mi->mbmi;;
+    xd->above_mbmi = xd->above_mi ? &xd->above_mi->mbmi : NULL;
   } else {
     xd->above_mi = NULL;
     xd->above_mbmi = NULL;
@@ -319,7 +319,7 @@
 
   if (xd->left_available) {
     xd->left_mi = xd->mi[-1].src_mi;
-    xd->left_mbmi = &xd->left_mi->mbmi;;
+    xd->left_mbmi = xd->left_mi ? &xd->left_mi->mbmi : NULL;
   } else {
     xd->left_mi = NULL;
     xd->left_mbmi = NULL;