Fix potential "divide by zero" in examples found by coverity

Change-Id: Ic41f9cb2ac24450986cd061db718953276eee080
This commit is contained in:
Vincent Rabaud 2025-01-13 10:42:03 +01:00
parent 2af6c034ac
commit f8f2410710

View File

@ -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);
}
}