From e05aff730dbc581bb4e9b8096fd72e94be750e23 Mon Sep 17 00:00:00 2001 From: Qiwei Liu Date: Wed, 29 Jul 2020 11:35:59 +0800 Subject: [PATCH] msm: vidc: fix less_or_equal resolution check For less_or_equal check, need to meet all the conditions when return true, not only one condition. Change-Id: Icf103721596cdcb6a4a90e1def67f3151140db85 Signed-off-by: Qiwei Liu --- msm/vidc/msm_vidc_clocks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msm/vidc/msm_vidc_clocks.c b/msm/vidc/msm_vidc_clocks.c index 59dfd21a88dc..4e2a8958a008 100644 --- a/msm/vidc/msm_vidc_clocks.c +++ b/msm/vidc/msm_vidc_clocks.c @@ -120,8 +120,8 @@ bool res_is_less_than_or_equal_to(u32 width, u32 height, u32 num_mbs = NUM_MBS_PER_FRAME(height, width); u32 max_side = max(ref_width, ref_height); - if (num_mbs <= NUM_MBS_PER_FRAME(ref_height, ref_width) || - width <= max_side || + if (num_mbs <= NUM_MBS_PER_FRAME(ref_height, ref_width) && + width <= max_side && height <= max_side) return true; else