From eace660b7d6227dcdaab89de4da97f2cc5d5daae Mon Sep 17 00:00:00 2001
From: Anton Orlenko <[EMAIL REDACTED]>
Date: Thu, 29 May 2025 17:44:22 +0300
Subject: [PATCH] IMG_ImageIO.m: replaced hint dictionary with NULL in
CreateCGImageSourceFromIOStream call within Internal_isType
Passing hint caused certain WebP images to be falsely identified as TIFF images.
Passing NULL forces CGImageSourceCreateWithDataProvider figure out the format on its own.
(cherry picked from commit e28c7c7623ed447c10977849013c6e3c815f0788)
---
src/IMG_ImageIO.m | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/IMG_ImageIO.m b/src/IMG_ImageIO.m
index c357195e8..96cdd9d51 100644
--- a/src/IMG_ImageIO.m
+++ b/src/IMG_ImageIO.m
@@ -365,12 +365,7 @@ static bool Internal_isType (SDL_IOStream *rw_ops, CFStringRef uti_string_to_tes
}
Sint64 start = SDL_TellIO(rw_ops);
- CFDictionaryRef hint_dictionary = CreateHintDictionary(uti_string_to_test);
- CGImageSourceRef image_source = CreateCGImageSourceFromIOStream(rw_ops, hint_dictionary);
-
- if (hint_dictionary != NULL) {
- CFRelease(hint_dictionary);
- }
+ CGImageSourceRef image_source = CreateCGImageSourceFromIOStream(rw_ops, NULL);
if (NULL == image_source) {
// reset the file pointer