SDL_image: Only set the light level properties if they're set in the source image

From adbe4cf9e152a0a81b79a84543155e63c81c222b Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 21 Feb 2024 10:01:57 -0800
Subject: [PATCH] Only set the light level properties if they're set in the
 source image

---
 src/IMG_avif.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/IMG_avif.c b/src/IMG_avif.c
index 3a150375..043edee0 100644
--- a/src/IMG_avif.c
+++ b/src/IMG_avif.c
@@ -441,8 +441,10 @@ SDL_Surface *IMG_LoadAVIF_RW(SDL_RWops *src)
                                                               SDL_MATRIX_COEFFICIENTS_IDENTITY,
                                                               SDL_CHROMA_LOCATION_NONE);
             SDL_SetNumberProperty(props, SDL_PROP_SURFACE_COLORSPACE_NUMBER, colorspace);
-            if (image->clli.maxCLL > 0 || image->clli.maxPALL > 0) {
+            if (image->clli.maxCLL > 0) {
                 SDL_SetNumberProperty(props, SDL_PROP_SURFACE_MAXCLL_NUMBER, image->clli.maxCLL);
+            }
+            if (image->clli.maxPALL > 0) {
                 SDL_SetNumberProperty(props, SDL_PROP_SURFACE_MAXFALL_NUMBER, image->clli.maxPALL);
             }
         }