From: Marco Date: Wed, 6 Jan 2016 19:30:02 +0000 (-0800) Subject: vp9-svc: Fix to avoid msan unitialized value. X-Git-Tag: v1.6.0~453 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b520882f0eb2648e0d1e5090597ba43aa561e2f1;p=libvpx vp9-svc: Fix to avoid msan unitialized value. Move the logic for forcing zero_mode after the (ref_frame & flag_list) check. This was causing an memory leak under msan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5402 Change-Id: Ie9d243369f8ed7c332f46178275945331da4fd85 --- diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index b929758ca..0d1056075 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -1263,9 +1263,6 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ref_frame = ref_mode_set[idx].ref_frame; if (cpi->use_svc) { ref_frame = ref_mode_set_svc[idx].ref_frame; - if (svc_force_zero_mode[ref_frame - 1] && - frame_mv[this_mode][ref_frame].as_int != 0) - continue; } if (!(cpi->ref_frame_flags & flag_list[ref_frame])) @@ -1273,6 +1270,12 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, if (const_motion[ref_frame] && this_mode == NEARMV) continue; + if (cpi->use_svc) { + if (svc_force_zero_mode[ref_frame - 1] && + frame_mv[this_mode][ref_frame].as_int != 0) + continue; + } + if (!(frame_mv[this_mode][ref_frame].as_int == 0 && ref_frame == LAST_FRAME)) { i = (ref_frame == LAST_FRAME) ? GOLDEN_FRAME : LAST_FRAME;