From: Jerome Jiang Date: Mon, 16 Oct 2023 15:22:48 +0000 (-0400) Subject: Fix ubsan failure caused by left shift of negative X-Git-Tag: accepted/tizen/7.0/unified/20240521.012539~1^2~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0129e64a65594a2af81df5df2ad474dd168a1519;p=platform%2Fupstream%2Flibvpx.git Fix ubsan failure caused by left shift of negative Bug: b/305642441 Change-Id: Iddb1572c284161140da48f61b04cf600e5b57ecc --- diff --git a/vp8/encoder/mcomp.c b/vp8/encoder/mcomp.c index b92e213..bc150e4 100644 --- a/vp8/encoder/mcomp.c +++ b/vp8/encoder/mcomp.c @@ -1123,8 +1123,8 @@ int vp8_diamond_search_sad_c(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv, } } - this_mv.as_mv.row = best_mv->as_mv.row << 3; - this_mv.as_mv.col = best_mv->as_mv.col << 3; + this_mv.as_mv.row = best_mv->as_mv.row * 8; + this_mv.as_mv.col = best_mv->as_mv.col * 8; return fn_ptr->vf(what, what_stride, best_address, in_what_stride, &thissad) + mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit); @@ -1441,8 +1441,8 @@ int vp8_refining_search_sad_c(MACROBLOCK *x, BLOCK *b, BLOCKD *d, } } - this_mv.as_mv.row = ref_mv->as_mv.row << 3; - this_mv.as_mv.col = ref_mv->as_mv.col << 3; + this_mv.as_mv.row = ref_mv->as_mv.row * 8; + this_mv.as_mv.col = ref_mv->as_mv.col * 8; return fn_ptr->vf(what, what_stride, best_address, in_what_stride, &thissad) + mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit);