commit c27534c89a763cf0022d186e5f89bdbba33731e8
Author: Dragos Oancea <dragos@signalwire.com>
Date: Thu Feb 20 10:09:21 2020 +0000
[libvpx] scan-build: Division by zero - measure_square_diff_partial()
diff --git a/libs/libvpx/vp8/encoder/onyx_if.c b/libs/libvpx/vp8/encoder/onyx_if.c
index f05cfdb140..4557e85789 100644
--- a/libs/libvpx/vp8/encoder/onyx_if.c
+++ b/libs/libvpx/vp8/encoder/onyx_if.c
@@ -3007,7 +3007,7 @@ static int measure_square_diff_partial(YV12_BUFFER_CONFIG *source,
// Only return non-zero if we have at least ~1/16 samples for estimate.
if (num_blocks > (tot_num_blocks >> 4)) {
assert(num_blocks != 0);
- return (Total / num_blocks);
+ return num_blocks ? (Total / num_blocks) : 0;
} else {
return 0;
}