SDL_image: IMG_libpng: move png_get_uint_32 to 'lib' structure

From ae730236050ffd7353abdead880cb8fc054396eb Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Fri, 9 Jan 2026 03:15:50 +0300
Subject: [PATCH] IMG_libpng: move png_get_uint_32 to 'lib' structure

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

diff --git a/src/IMG_libpng.c b/src/IMG_libpng.c
index fa5ca4e7..18a54238 100644
--- a/src/IMG_libpng.c
+++ b/src/IMG_libpng.c
@@ -175,6 +175,7 @@ static struct
     png_uint_32 (*png_get_image_width)(png_const_structrp png_ptr, png_const_inforp info_ptr);
     png_uint_32 (*png_get_image_height)(png_const_structrp png_ptr, png_const_inforp info_ptr);
     png_uint_32 (*png_get_text)(png_const_structp png_ptr, png_infop info_ptr, png_textp *text_ptr, int *num_text);
+    png_uint_32 (*png_get_uint_32)(png_const_bytep buf);
 
     void (*png_write_flush)(png_structrp png_ptr);
 } lib;
@@ -280,6 +281,7 @@ bool IMG_InitPNG(void)
         FUNCTION_LOADER_LIBPNG(png_get_image_width, png_uint_32(*)(png_const_structrp png_ptr, png_const_inforp info_ptr))
         FUNCTION_LOADER_LIBPNG(png_get_image_height, png_uint_32(*)(png_const_structrp png_ptr, png_const_inforp info_ptr))
         FUNCTION_LOADER_LIBPNG(png_get_text, png_uint_32 (*)(png_const_structrp png_ptr, png_inforp info_ptr, png_textp *text_ptr, int *num_text))
+        FUNCTION_LOADER_LIBPNG(png_get_uint_32, png_uint_32 (*)(png_const_bytep buf))
 
         FUNCTION_LOADER_LIBPNG(png_write_flush, void (*)(png_structrp png_ptr))
     }
@@ -1730,7 +1732,7 @@ static png_bytep compress_surface_to_png_data(CompressionContext *context, SDL_S
             break;
         }
         SDL_memcpy(context->chunk_header, context->mem_buffer_ptr + context->current_pos, 8);
-        context->chunk_len = png_get_uint_32(context->chunk_header);
+        context->chunk_len = lib.png_get_uint_32(context->chunk_header);
         SDL_memcpy(context->chunk_type, context->chunk_header + 4, 4);
 
         context->current_pos += 8;