From e8a2047d4c8702904f0cb0099fee5f77c90fb3d6 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 22 Nov 2025 13:11:00 +0500 Subject: [PATCH] engine: client: use utility function to copy an image before quantization --- engine/client/cl_spray.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/engine/client/cl_spray.c b/engine/client/cl_spray.c index 5525bebc..1b5be862 100644 --- a/engine/client/cl_spray.c +++ b/engine/client/cl_spray.c @@ -132,10 +132,7 @@ qboolean CL_ConvertImageToWAD3( const char *filename ) } else { - quant = Mem_Malloc( host.imagepool, sizeof( *quant )); - *quant = *image; - quant->buffer = Mem_Malloc( host.imagepool, quant->size ); - memcpy( quant->buffer, image->buffer, quant->size ); + quant = FS_CopyImage( image ); Image_Quantize( quant ); // it's so weird, it writes result to same structure as used for input data if( !quant || !quant->buffer || !quant->palette )