mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
Minor issues fixed
*Memory leak in image decodification modules. *Changed mouse wheel delta value.
This commit is contained in:
parent
1024a7c7c4
commit
b85d39bfc3
4 changed files with 17 additions and 20 deletions
|
|
@ -217,13 +217,12 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, u32 data_addr, u32 dataC
|
|||
for(u32 i = 0; i < fileSize; i++){
|
||||
jpg[i] = Memory.Read8(buffer+i);
|
||||
}
|
||||
Memory.Free(buffer);
|
||||
|
||||
unsigned char *image = stbi_load_from_memory((const unsigned char*)jpg, fileSize, &width, &height, &actual_components, 4);
|
||||
if (!image)
|
||||
{
|
||||
Memory.Free(buffer);
|
||||
return CELL_JPGDEC_ERROR_STREAM_FORMAT;
|
||||
}
|
||||
delete[] jpg;
|
||||
if (!image) return CELL_JPGDEC_ERROR_STREAM_FORMAT;
|
||||
|
||||
u32 image_size = width * height * 4;
|
||||
if (inParam.outputColorSpace == CELL_JPG_RGBA){
|
||||
for(u32 i = 0; i < image_size; i+=4){
|
||||
|
|
@ -241,7 +240,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, u32 data_addr, u32 dataC
|
|||
Memory.Write8(data_addr+i+3, image[i+2]);
|
||||
}
|
||||
}
|
||||
Memory.Free(buffer);
|
||||
delete[] image;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue