diff --git a/src/oapv_tq.c b/src/oapv_tq.c index b2a8539..f52f8df 100644 --- a/src/oapv_tq.c +++ b/src/oapv_tq.c @@ -407,7 +407,7 @@ static void oapv_dquant(s16 *coef, s16 q_matrix[OAPV_BLK_D], int log2_w, int log } } else { - int left_shift = -shift; + int left_shift = oapv_clip3(0, 30, -shift); for(i = 0; i < pixels; i++) { lev = (coef[i] * q_matrix[i]) << left_shift; coef[i] = (s16)oapv_clip3(-32768, 32767, lev);