]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[libvpx] scan-build: Division by zero - measure_square_diff_partial()
authorDragos Oancea <dragos@signalwire.com>
Thu, 20 Feb 2020 10:09:21 +0000 (10:09 +0000)
committerAndrey Volk <andywolk@gmail.com>
Fri, 10 Jul 2026 16:38:46 +0000 (19:38 +0300)
libs/libvpx/vp8/encoder/onyx_if.c

index f05cfdb1407e260cbfb0be114fff8c79b862e938..4557e8578938c4d9e039c206044aa0dbb88d9c18 100644 (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;
   }