]> granicus.if.org Git - libvpx/commitdiff
vp9-svc: Fix to avoid msan unitialized value.
authorMarco <marpan@google.com>
Wed, 6 Jan 2016 19:30:02 +0000 (11:30 -0800)
committerMarco <marpan@google.com>
Wed, 6 Jan 2016 19:34:57 +0000 (11:34 -0800)
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

vp9/encoder/vp9_pickmode.c

index b929758ca5404b8e9923cc772febbc7149631a5a..0d1056075fa2c436296e2ef8d9ab41a20d5c8596 100644 (file)
@@ -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;