rdopt.c: add an assert before using value in shift Fixes a clang-19 static analysis warnings of the form: ``` The result of left shift is undefined because the right operand is negative ``` Bug: 474642915 Change-Id: I410f5119dc29a468b9636f8350fd79aa3b49ed5c
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c index fcbc4db..ec3d067 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c
@@ -4755,6 +4755,7 @@ int skip_motion_mode = 0; if (mbmi->partition != PARTITION_NONE) { + assert(ref_type > NONE_FRAME); int skip_ref = skip_ref_frame_mask & (1 << ref_type); if (ref_type <= ALTREF_FRAME && skip_ref) { // Since the compound ref modes depends on the motion estimation result of