]> granicus.if.org Git - libvpx/commitdiff
Fix an ioc issue in super_block_uvrd
authorJingning Han <jingning@google.com>
Thu, 16 Oct 2014 16:19:42 +0000 (09:19 -0700)
committerJingning Han <jingning@google.com>
Thu, 16 Oct 2014 18:07:39 +0000 (11:07 -0700)
This commit fixes an ioc issue that will happen when the cumulative
variables are not in effective use. The fix discards these
redundant additions.

Change-Id: Idbac5bfb989c0cedc5f8a323effce938519b2457

vp9/encoder/vp9_rdopt.c

index 7565cc5c9fc6ba2642c15a4b0050dc92ef839a81..502089e6afed39e183d361eb3df3fbf2290cf326 100644 (file)
@@ -1140,12 +1140,14 @@ static int super_block_uvrd(const VP9_COMP *cpi, MACROBLOCK *x,
   *sse = 0;
   *skippable = 1;
 
-  for (plane = 1; plane < MAX_MB_PLANE && is_cost_valid; ++plane) {
+  for (plane = 1; plane < MAX_MB_PLANE; ++plane) {
     txfm_rd_in_plane(x, &pnrate, &pndist, &pnskip, &pnsse,
                      ref_best_rd, plane, bsize, uv_tx_size,
                      cpi->sf.use_fast_coef_costing);
-    if (pnrate == INT_MAX)
+    if (pnrate == INT_MAX) {
       is_cost_valid = 0;
+      break;
+    }
     *rate += pnrate;
     *distortion += pndist;
     *sse += pnsse;