[libvpx] scan-build: Division by zero - measure_square_diff_partial()

This commit is contained in:
Dragos Oancea
2020-02-20 10:09:21 +00:00
committed by Andrey Volk
parent f4c9499198
commit c27534c89a
+1 -1
View File
@@ -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;
}