shithub: libvpx

Download patch

ref: 1ff15fbffe35e45251089e86ef258baaa076f2cd
parent: 90ea10ec91509aeafcfda588b7ab9ea75f038264
parent: 238b6be24bcd6cbb626d88d08fceb12622f7ad89
author: Jingning Han <[email protected]>
date: Thu Mar 12 05:24:02 EDT 2015

Merge "Prevent integer overflow in choose_partitioning"

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -611,12 +611,12 @@
       const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
 
       if (bs == BLOCK_INVALID)
-        uv_sad = INT_MAX;
+        uv_sad = UINT_MAX;
       else
         uv_sad = cpi->fn_ptr[bs].sdf(p->src.buf, p->src.stride,
                                      pd->dst.buf, pd->dst.stride);
 
-      x->color_sensitivity[i - 1] = uv_sad * 4 > y_sad;
+      x->color_sensitivity[i - 1] = uv_sad > (y_sad >> 2);
     }
 
     d = xd->plane[0].dst.buf;