SCC_DETERMINATION: Fix SIGFPE (divide by zero).

Division by 0 was occuring under some compilers when palette_ratio == 0.0
diff --git a/av1/encoder/encoder_utils.c b/av1/encoder/encoder_utils.c
index 9529e21..b8f5094 100644
--- a/av1/encoder/encoder_utils.c
+++ b/av1/encoder/encoder_utils.c
@@ -908,15 +908,23 @@
   const double palette_ratio =
       (double)cpi->palette_pixel_num / (double)(cm->height * cm->width);
   const int psnr_diff_is_large = (psnr_diff > STRICT_PSNR_DIFF_THRESH);
-  const int ratio_is_large =
-      ((palette_ratio >= 0.0001) && ((psnr_diff / palette_ratio) > 4));
+  // Note: These two conditions are intentionally separated because combining
+  // them can cause division by zero under some compiler configurations (e.g.
+  // clang-16 + address sanitizer) when palette_ratio == 0.0.
+  int ratio_is_large = (palette_ratio >= 0.0001);
+  if (ratio_is_large) {
+    ratio_is_large = ((psnr_diff / palette_ratio) > 4);
+  }
   const int is_sc_encoding_much_better = (psnr_diff_is_large || ratio_is_large);
 
   // the following two flags are used to determine if we enable intrabc or not.
   // Since intrabc is an expensive tool, we raise the threshold of
   // palette_ratio.
-  const int ratio_is_large_2 =
-      ((palette_ratio >= 0.25) && ((psnr_diff / palette_ratio) > 4));
+  // Note: these two conditions are intentionally separated (see note above).
+  int ratio_is_large_2 = (palette_ratio >= 0.25);
+  if (ratio_is_large_2) {
+    ratio_is_large_2 = ((psnr_diff / palette_ratio) > 4);
+  }
   const int is_sc_encoding_much_better_2 =
       (psnr_diff_is_large || ratio_is_large_2);
 #else