Commit ee808e52 authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

Fix overflow in RD error calculation code.

Change-Id: I61ef1f198c876f9f79787ea7d7385a862cfbae19
parent be7d4f96
......@@ -603,7 +603,7 @@ static int block_error(int16_t *coeff, int16_t *dqcoeff,
for (i = 0; i < block_size; i++) {
int this_diff = coeff[i] - dqcoeff[i];
error += this_diff * this_diff;
error += (unsigned)this_diff * this_diff;
}
error >>= shift;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment