From eef344a740fb068a724c29dab341b8a29b82669e Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Thu, 25 Feb 2010 11:47:16 +0000 Subject: [PATCH] Use xmalloc --- Src/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/utils.cpp b/Src/utils.cpp index dedaa26..7b72d92 100644 --- a/Src/utils.cpp +++ b/Src/utils.cpp @@ -257,7 +257,7 @@ void *sdl_surface_to_png(SDL_Surface *surf, size_t *out_sz) png_write_info(png_ptr, info_ptr); png_set_packing(png_ptr); - row_pointers = (png_bytep*) malloc(sizeof(png_bytep)*surf->h); + row_pointers = (png_bytep*) xmalloc(sizeof(png_bytep)*surf->h); for (i = 0; i < surf->h; i++) row_pointers[i] = (png_bytep)(Uint8 *)surf->pixels + i*surf->pitch; png_write_image(png_ptr, row_pointers);