From 0625101dd3b585d98cc14366ccb80d5aada9676f Mon Sep 17 00:00:00 2001 From: xchellx Date: Thu, 17 Oct 2024 23:47:31 -0400 Subject: [PATCH] Fix STBIR__FREE_AND_CLEAR causing null reference member access `stb_image_resize2.h:6734:5: runtime error: member access within null pointer of type 'stbir__info' (aka 'struct stbir__info')` --- stb_image_resize2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stb_image_resize2.h b/stb_image_resize2.h index b982eb1..405a665 100644 --- a/stb_image_resize2.h +++ b/stb_image_resize2.h @@ -6689,7 +6689,7 @@ static void stbir__get_split_info( stbir__per_split_info* split_info, int splits static void stbir__free_internal_mem( stbir__info *info ) { - #define STBIR__FREE_AND_CLEAR( ptr ) { if ( ptr ) { void * p = (ptr); (ptr) = 0; STBIR_FREE( p, info->user_data); } } + #define STBIR__FREE_AND_CLEAR( ptr ) { if ( ptr ) { void * p = (ptr); STBIR_FREE( p, info->user_data); (ptr) = 0; } } if ( info ) {