From 1d3f901aa016d42b5bc0148be2ef6c0fd56f3b81 Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Fri, 25 Dec 2020 12:29:44 -0800 Subject: [PATCH] Scale bug fix with msan when scaling up in height and down in width with box filter. runyuv3 Scale*Rotate_Box --libyuv_width=200 --libyuv_height=50 Bug: chromium:1158178, libyuv:875, b/176195584 Change-Id: Ic9a380179433bf3dffb951e7b5563491592d5aa5 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2603877 Reviewed-by: Eugene Zemtsov Reviewed-by: Frank Barchard --- source/scale_common.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/scale_common.cc b/source/scale_common.cc index fd4cbd038..81959925c 100644 --- a/source/scale_common.cc +++ b/source/scale_common.cc @@ -1412,8 +1412,8 @@ enum FilterMode ScaleFilterReduce(int src_width, src_height = -src_height; } if (filtering == kFilterBox) { - // If scaling both axis to 0.5 or larger, switch from Box to Bilinear. - if (dst_width * 2 >= src_width && dst_height * 2 >= src_height) { + // If scaling either axis to 0.5 or larger, switch from Box to Bilinear. + if (dst_width * 2 >= src_width || dst_height * 2 >= src_height) { filtering = kFilterBilinear; } }