shithub: libvpx

Download patch

ref: 0310ebd8d1f44eca865f33c063ad4410969d3b94
parent: 50bbc0984c736133830ecdeb710b003dab2af699
author: Angie Chiang <angiebird@google.com>
date: Mon Nov 19 05:25:35 EST 2018

Fix scan_build warnings in tiny_ssim.c

BUG=webm:1575

Change-Id: I3ad3af49d778f102e9152dcb1eb9d5c048756cdf

--- a/tools/tiny_ssim.c
+++ b/tools/tiny_ssim.c
@@ -53,6 +53,10 @@
   unsigned int row, col;
   uint64_t total_sse = 0;
   int diff;
+  if (orig == NULL || recon == NULL) {
+    assert(0);
+    return 0;
+  }
 
   for (row = 0; row < rows; row++) {
     for (col = 0; col < cols; col++) {
@@ -99,6 +103,9 @@
                            int h, int bit_depth) {
   char y4m_buf[4];
   size_t r1;
+  input->w = w;
+  input->h = h;
+  input->bit_depth = bit_depth;
   input->type = RAW_YUV;
   input->buf = NULL;
   input->file = strcmp(file_name, "-") ? fopen(file_name, "rb") : stdin;
@@ -187,6 +194,11 @@
                     uint32_t *sum_s, uint32_t *sum_r, uint32_t *sum_sq_s,
                     uint32_t *sum_sq_r, uint32_t *sum_sxr) {
   int i, j;
+  if (s == NULL || r == NULL || sum_s == NULL || sum_r == NULL ||
+      sum_sq_s == NULL || sum_sq_r || sum_sxr == NULL) {
+    assert(0);
+    return;
+  }
   for (i = 0; i < 8; i++, s += sp, r += rp) {
     for (j = 0; j < 8; j++) {
       *sum_s += s[j];