ref: 6234256646fe5f02defdc57a48bb8a81a7d4a6d6
parent: 49b6b99f5c0805a8b7961b0cccec03cabdedb209
author: Angie Chiang <angiebird@google.com>
date: Tue Nov 20 11:39:53 EST 2018
Fix scan_build warnings in tiny_ssim.c BUG=webm:1575 Change-Id: I022794054b494512903d912bdbf3e85461f31665
--- a/tools/tiny_ssim.c
+++ b/tools/tiny_ssim.c
@@ -34,6 +34,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++) {
@@ -195,7 +199,7 @@
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) {
+ sum_sq_s == NULL || sum_sq_r == NULL || sum_sxr == NULL) {
assert(0);
return;
}
@@ -214,6 +218,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 == NULL || 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];