diff --git a/tools/quake3/common/imagelib.c b/tools/quake3/common/imagelib.c index 6c72c071..ac4581be 100644 --- a/tools/quake3/common/imagelib.c +++ b/tools/quake3/common/imagelib.c @@ -516,10 +516,7 @@ void LoadPCX( const char *filename, byte **pic, byte **palette, int *width, int return; } - out = safe_malloc( ( pcx->ymax + 1 ) * ( pcx->xmax + 1 ) ); - if ( !out ) { - Error( "LoadPCX: couldn't allocate" ); - } + out = safe_malloc_info( ( pcx->ymax + 1 ) * ( pcx->xmax + 1 ), "LoadPCX" ); *pic = out; pix = out; @@ -1005,11 +1002,7 @@ void LoadTGABuffer( const byte *f, const byte *enddata, byte **pic, int *width, return; } - image_rgba = safe_malloc( image_width * image_height * 4 ); - if ( !image_rgba ) { - Sys_Printf( "LoadTGA: not enough memory for %i by %i image\n", image_width, image_height ); - return; - } + image_rgba = safe_malloc_info( image_width * image_height * 4, "LoadTGABuffer" ); // If bit 5 of attributes isn't set, the image has been stored from bottom to top if ( ( targa_header.attributes & 0x20 ) == 0 ) { diff --git a/tools/quake3/q3map2/lightmaps_ydnar.c b/tools/quake3/q3map2/lightmaps_ydnar.c index 30c0a57e..60eed9f8 100644 --- a/tools/quake3/q3map2/lightmaps_ydnar.c +++ b/tools/quake3/q3map2/lightmaps_ydnar.c @@ -2172,10 +2172,7 @@ static void FindOutLightmaps( rawLightmap_t *lm, qboolean fastAllocate ){ if ( ok == qfalse ) { /* allocate LIGHTMAP_RESERVE_COUNT new output lightmaps */ numOutLightmaps += LIGHTMAP_RESERVE_COUNT; - olm = safe_malloc( numOutLightmaps * sizeof( outLightmap_t ) ); - if ( !olm ){ - Error( "FindOutLightmaps: Failed to allocate memory.\n" ); - } + olm = safe_malloc_info( numOutLightmaps * sizeof( outLightmap_t ), "FindOutLightmaps" ); if ( outLightmaps != NULL && numOutLightmaps > LIGHTMAP_RESERVE_COUNT ) { memcpy( olm, outLightmaps, ( numOutLightmaps - LIGHTMAP_RESERVE_COUNT ) * sizeof( outLightmap_t ) );