ref: d53fb0fda53cefc994e9077470a633b92604384a
parent: f003f77b8c83656f7f04e60b7d40a2126f1871de
author: hkuang <[email protected]>
date: Fri May 8 11:42:50 EDT 2015
Fix clang ioc warning due to NULL 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: I0713b4660d71e229e196654cb0970ba6b1574f28
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -380,7 +380,8 @@
xd->left_available = (mi_col > tile->mi_col_start);
if (xd->up_available) {
xd->above_mi = xd->mi[-xd->mi_stride];
- xd->above_mbmi = &xd->above_mi->mbmi;
+ // above_mi may be NULL in VP9 encoder's first pass.
+ xd->above_mbmi = xd->above_mi ? &xd->above_mi->mbmi : NULL;
} else {
xd->above_mi = NULL;
xd->above_mbmi = NULL;
@@ -388,7 +389,8 @@
if (xd->left_available) {
xd->left_mi = xd->mi[-1];
- xd->left_mbmi = &xd->left_mi->mbmi;
+ // left_mi may be NULL in VP9 encoder's first pass.
+ xd->left_mbmi = xd->left_mi ? &xd->left_mi->mbmi : NULL;
} else {
xd->left_mi = NULL;
xd->left_mbmi = NULL;