shithub: libvpx

Download patch

ref: 50bbc0984c736133830ecdeb710b003dab2af699
parent: ac3eccdc24bccece5f73ee67b88154f3bf4a4e9a
author: Angie Chiang <[email protected]>
date: Mon Nov 19 05:23:02 EST 2018

Fix scan_build warning in dct_partial_test.cc

BUG=webm:1575

Change-Id: Ib5d1a411a223a93d1795ebe1af12e67d64fadabe

--- a/test/dct_partial_test.cc
+++ b/test/dct_partial_test.cc
@@ -39,10 +39,14 @@
 
 tran_low_t partial_fdct_ref(const Buffer<int16_t> &in, int size) {
   int64_t sum = 0;
-  for (int y = 0; y < size; ++y) {
-    for (int x = 0; x < size; ++x) {
-      sum += in.TopLeftPixel()[y * in.stride() + x];
+  if (in.TopLeftPixel() != NULL) {
+    for (int y = 0; y < size; ++y) {
+      for (int x = 0; x < size; ++x) {
+        sum += in.TopLeftPixel()[y * in.stride() + x];
+      }
     }
+  } else {
+    assert(0);
   }
 
   switch (size) {
@@ -77,21 +81,25 @@
     Buffer<tran_low_t> output_block = Buffer<tran_low_t>(size_, size_, 0, 16);
     ASSERT_TRUE(output_block.Init());
 
-    for (int i = 0; i < 100; ++i) {
-      if (i == 0) {
-        input_block.Set(maxvalue);
-      } else if (i == 1) {
-        input_block.Set(minvalue);
-      } else {
-        input_block.Set(&rnd, minvalue, maxvalue);
-      }
+    if (output_block.TopLeftPixel() != NULL) {
+      for (int i = 0; i < 100; ++i) {
+        if (i == 0) {
+          input_block.Set(maxvalue);
+        } else if (i == 1) {
+          input_block.Set(minvalue);
+        } else {
+          input_block.Set(&rnd, minvalue, maxvalue);
+        }
 
-      ASM_REGISTER_STATE_CHECK(fwd_txfm_(input_block.TopLeftPixel(),
-                                         output_block.TopLeftPixel(),
-                                         input_block.stride()));
+        ASM_REGISTER_STATE_CHECK(fwd_txfm_(input_block.TopLeftPixel(),
+                                           output_block.TopLeftPixel(),
+                                           input_block.stride()));
 
-      EXPECT_EQ(partial_fdct_ref(input_block, size_),
-                output_block.TopLeftPixel()[0]);
+        EXPECT_EQ(partial_fdct_ref(input_block, size_),
+                  output_block.TopLeftPixel()[0]);
+      }
+    } else {
+      assert(0);
     }
   }