diff --git a/source/psp/video_hardware_images.cpp b/source/psp/video_hardware_images.cpp index 9674f44..74fb8e3 100644 --- a/source/psp/video_hardware_images.cpp +++ b/source/psp/video_hardware_images.cpp @@ -67,9 +67,9 @@ byte *LoadJPG (FILE *fin, int matchwidth, int matchheight) Con_Printf("JPG: Allocating data\n"); - data = static_cast(malloc (cinfo.image_width * cinfo.image_height * 4)); + data = static_cast(Hunk_Alloc(cinfo.image_width * cinfo.image_height * 4)); row_stride = cinfo.output_width * cinfo.output_components; - scanline = static_cast(malloc (row_stride)); + scanline = static_cast(Hunk_Alloc(row_stride)); Con_Printf("JPG: done allocating data\n"); @@ -111,7 +111,6 @@ byte *LoadJPG (FILE *fin, int matchwidth, int matchheight) jpeg_finish_decompress (&cinfo); jpeg_destroy_decompress (&cinfo); - free (scanline); fclose (fin); return data;