Skip to content

Commit

Permalink
Fix potential "divide by zero" in examples found by coverity
Browse files Browse the repository at this point in the history
Change-Id: Ic41f9cb2ac24450986cd061db718953276eee080
  • Loading branch information
vrabaud committed Jan 16, 2025
1 parent 2af6c03 commit f8f2410
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/anim_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit f8f2410

Please # to comment.