mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix a another memory leak in etctool.
imgdec = (unsigned char*) malloc(expandedwidth*expandedheight*3); is called before the if statement "if((f=fopen(dstfile,"wb")))" If the file 'f' failed in the if statement, it would never be freed (since "free(imgdec)" was within that if block.
This commit is contained in:
parent
5b5eec793f
commit
366de9f248
1 changed files with 3 additions and 2 deletions
|
@ -612,9 +612,10 @@ void compressImageFile(uint8 *img,int width,int height,char *dstfile, int expand
|
|||
printf("\n");
|
||||
|
||||
fclose(f);
|
||||
free(imgdec);
|
||||
printf("Saved file <%s>.\n",dstfile);
|
||||
printf("Saved file <%s>.\n",dstfile);
|
||||
}
|
||||
|
||||
free(imgdec);
|
||||
}
|
||||
|
||||
double calculatePSNR(uint8 *lossyimg, uint8 *origimg, int width, int height)
|
||||
|
|
Loading…
Add table
Reference in a new issue