]> granicus.if.org Git - libvpx/commitdiff
Fix an IOC issue in vp9_rd_pick_inter_mode_sb
authorJingning Han <jingning@google.com>
Sun, 5 Oct 2014 19:05:14 +0000 (12:05 -0700)
committerJingning Han <jingning@google.com>
Sun, 5 Oct 2014 19:05:14 +0000 (12:05 -0700)
It is possible that the GOLDEN reference frame is not avaiable, in
which setting the predicted mv will be associated with a residual
value of INT_MAX. This commit checks this condition before
left shift and comparison with that of ALTREF frame, to avoid
overflow issue.

Change-Id: Ib98c3149dbdd016f2fe5beaafb13f67d469dd07c

vp9/encoder/vp9_rdopt.c

index fd67ab5bdf4d573084f5770d385ed63a50289ad0..43300ae44113cb73cef0f2c0053edf36f82ef32b 100644 (file)
@@ -2675,7 +2675,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
   }
 
   if (cpi->sf.alt_ref_search_fp)
-    if (!cm->show_frame)
+    if (!cm->show_frame && x->pred_mv_sad[GOLDEN_FRAME] < INT_MAX)
       if (x->pred_mv_sad[ALTREF_FRAME] > (x->pred_mv_sad[GOLDEN_FRAME] << 1))
         mode_skip_mask[ALTREF_FRAME] |= INTER_ALL;