]> granicus.if.org Git - libvpx/commitdiff
Fix scan_build_warnings in comp_avg_pred_test.cc
authorAngie Chiang <angiebird@google.com>
Mon, 19 Nov 2018 19:31:25 +0000 (11:31 -0800)
committerAngie Chiang <angiebird@google.com>
Tue, 20 Nov 2018 02:48:34 +0000 (18:48 -0800)
BUG=webm:1575

Change-Id: I9b5f8b08d23fd62ff6400605023f33e3890b0f2d

test/comp_avg_pred_test.cc

index 110e06583657ab45415c9368a9e40d3a58945213..6d658cbec343cd9473e35e802d0a7cd0cca45adc 100644 (file)
@@ -29,6 +29,11 @@ uint8_t avg_with_rounding(uint8_t a, uint8_t b) { return (a + b + 1) >> 1; }
 
 void reference_pred(const Buffer<uint8_t> &pred, const Buffer<uint8_t> &ref,
                     int width, int height, Buffer<uint8_t> *avg) {
+  if (avg->TopLeftPixel() == NULL || pred.TopLeftPixel() == NULL ||
+      ref.TopLeftPixel() == NULL) {
+    assert(0);
+    return;
+  }
   for (int y = 0; y < height; ++y) {
     for (int x = 0; x < width; ++x) {
       avg->TopLeftPixel()[y * avg->stride() + x] =