mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
(PS3) image_ps3.c - fix two potential memleaks
This commit is contained in:
parent
ceb09648eb
commit
028b0592f5
@ -148,6 +148,10 @@ static bool ps3_load_jpeg(const char *path, struct texture_image *out_img)
|
|||||||
|
|
||||||
img_size = outParam.output_width * outParam.output_height * sizeof(uint32_t);
|
img_size = outParam.output_width * outParam.output_height * sizeof(uint32_t);
|
||||||
out_img->pixels = (uint32_t*)malloc(img_size);
|
out_img->pixels = (uint32_t*)malloc(img_size);
|
||||||
|
|
||||||
|
if (!out_img->pixels)
|
||||||
|
goto error;
|
||||||
|
|
||||||
memset(out_img->pixels, 0, img_size);
|
memset(out_img->pixels, 0, img_size);
|
||||||
|
|
||||||
#ifdef __PSL1GHT__
|
#ifdef __PSL1GHT__
|
||||||
@ -263,6 +267,10 @@ static bool ps3_load_png(const char *path, struct texture_image *out_img)
|
|||||||
img_size = outParam.output_width *
|
img_size = outParam.output_width *
|
||||||
outParam.output_height * sizeof(uint32_t);
|
outParam.output_height * sizeof(uint32_t);
|
||||||
out_img->pixels = (uint32_t*)malloc(img_size);
|
out_img->pixels = (uint32_t*)malloc(img_size);
|
||||||
|
|
||||||
|
if (!out_img->pixels)
|
||||||
|
goto error;
|
||||||
|
|
||||||
memset(out_img->pixels, 0, img_size);
|
memset(out_img->pixels, 0, img_size);
|
||||||
|
|
||||||
#ifdef __PSL1GHT__
|
#ifdef __PSL1GHT__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user