shithub: libvpx

Download patch

ref: ee808e52bd0e371f0caad5ca7f29fbc4d5bf2aee
parent: be7d4f96a29e3934ac9352d3326f9bf31a6069a6
author: Ronald S. Bultje <rbultje@google.com>
date: Fri May 3 06:33:07 EDT 2013

Fix overflow in RD error calculation code.

Change-Id: I61ef1f198c876f9f79787ea7d7385a862cfbae19

--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -603,7 +603,7 @@
 
   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;