Fix IOC warnings av1_txfm.h: left shift of a negative number av1/encoder/quantize.c: unsigned int overflow aom_dsp/entenc.c: unsigned int overflow Change-Id: I6143e68f7d6e2621f97900808c8ef7ee0ad0c814
diff --git a/aom_dsp/entenc.c b/aom_dsp/entenc.c index 390f61b..214f183 100644 --- a/aom_dsp/entenc.c +++ b/aom_dsp/entenc.c
@@ -514,7 +514,7 @@ unsigned char *out; uint32_t storage; uint16_t *buf; - uint32_t offs; + int offs; uint32_t end_offs; int nend_bits; od_ec_window m; @@ -554,7 +554,7 @@ if (s > 0) { unsigned n; storage = enc->precarry_storage; - if (offs + ((s + 7) >> 3) > storage) { + if (offs + ((s + 7) >> 3) > (int)storage) { storage = storage * 2 + ((s + 7) >> 3); buf = (uint16_t *)realloc(buf, sizeof(*buf) * storage); if (buf == NULL) { @@ -566,7 +566,7 @@ } n = (1 << (c + 16)) - 1; do { - OD_ASSERT(offs < storage); + OD_ASSERT(offs < (int)storage); buf[offs++] = (uint16_t)(e >> (c + 16)); e &= n; s -= 8;
diff --git a/av1/common/av1_txfm.h b/av1/common/av1_txfm.h index 3b78981..c2f1b1a 100644 --- a/av1/common/av1_txfm.h +++ b/av1/common/av1_txfm.h
@@ -81,7 +81,7 @@ } } else { for (i = 0; i < size; i++) { - arr[i] = arr[i] << (-bit); + arr[i] = arr[i] * (1 << (-bit)); } } }
diff --git a/av1/encoder/quantize.c b/av1/encoder/quantize.c index 644a4c3..da01642 100644 --- a/av1/encoder/quantize.c +++ b/av1/encoder/quantize.c
@@ -1464,7 +1464,8 @@ #else const uint32_t abs_qcoeff = (uint32_t)((tmp2 * quant_shift_ptr[rc != 0]) >> shift); - qcoeff_ptr[rc] = (tran_low_t)((abs_qcoeff ^ coeff_sign) - coeff_sign); + qcoeff_ptr[rc] = + (tran_low_t)((int)(abs_qcoeff ^ coeff_sign) - coeff_sign); dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / scale; #endif // CONFIG_AOM_QM if (abs_qcoeff) eob = i;