fix potential use of uninitialized rate_y
authorJohn Koleszar <jkoleszar@google.com>
Wed, 14 Mar 2012 17:10:30 +0000 (10:10 -0700)
committerJohn Koleszar <jkoleszar@google.com>
Wed, 14 Mar 2012 17:10:30 +0000 (10:10 -0700)
This issue likely doesn't appear in the unmodified encoder, but
sufficient hacking on the mode selection loop can expose it.

Change-Id: I8a35831e8f08b549806d0c2c6900d42af883f78f

vp8/encoder/rdopt.c

index fdc7213..745a4a1 100644 (file)
@@ -741,7 +741,7 @@ static int rd_pick_intra4x4mby_modes(VP8_COMP *cpi, MACROBLOCK *mb, int *Rate,
         return INT_MAX;
 
     *Rate = cost;
-    *rate_y += tot_rate_y;
+    *rate_y = tot_rate_y;
     *Distortion = distortion;
 
     return RDCOST(mb->rdmult, mb->rddiv, cost, distortion);