From f8f241071001e1a3807f34a26a03a742ea843458 Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Mon, 13 Jan 2025 10:42:03 +0100 Subject: [PATCH] Fix potential "divide by zero" in examples found by coverity Change-Id: Ic41f9cb2ac24450986cd061db718953276eee080 --- examples/anim_util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/anim_util.c b/examples/anim_util.c index cf7da4c0..4ce093b9 100644 --- a/examples/anim_util.c +++ b/examples/anim_util.c @@ -771,6 +771,7 @@ void GetDiffAndPSNR(const uint8_t rgba1[], const uint8_t rgba2[], *psnr = 99.; // PSNR when images are identical. } else { sse /= stride * height; + assert(sse != 0.0); *psnr = 4.3429448 * log(255. * 255. / sse); } }