mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 01:38:37 +12:00
Add a parameter check to some Gif/Jpg/Png decoding syscalls
This commit is contained in:
parent
fc9a90e220
commit
9d0dd4c7cf
3 changed files with 36 additions and 0 deletions
|
@ -24,6 +24,9 @@ int cellPngDecOpen(u32 mainHandle, mem32_t subHandle, mem_ptr_t<CellPngDecSrc> s
|
|||
cellPngDec.Warning("cellPngDecOpen(mainHandle=0x%x, subHandle=0x%x, src_addr=0x%x, openInfo=0x%x)",
|
||||
mainHandle, subHandle.GetAddr(), src.GetAddr(), openInfo);
|
||||
|
||||
if (!subHandle.IsGood() || !src.IsGood())
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
|
||||
CellPngDecSubHandle *current_subHandle = new CellPngDecSubHandle;
|
||||
|
||||
current_subHandle->fd = NULL;
|
||||
|
@ -72,6 +75,9 @@ int cellPngDecClose(u32 mainHandle, u32 subHandle)
|
|||
|
||||
int cellPngDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellPngDecInfo> info)
|
||||
{
|
||||
if (!info.IsGood())
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
|
||||
cellPngDec.Warning("cellPngDecReadHeader(mainHandle=0x%x, subHandle=0x%x, info_addr=0x%llx)", mainHandle, subHandle, info.GetAddr());
|
||||
CellPngDecSubHandle* subHandle_data;
|
||||
if(!cellPngDec.CheckId(subHandle, subHandle_data))
|
||||
|
@ -129,6 +135,9 @@ int cellPngDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellPngDecInfo
|
|||
|
||||
int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const mem_ptr_t<CellPngDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellPngDecDataOutInfo> dataOutInfo)
|
||||
{
|
||||
if (!data.IsGood() || !dataCtrlParam.IsGood() || !dataOutInfo.IsGood())
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
|
||||
dataOutInfo->status = CELL_PNGDEC_DEC_STATUS_STOP;
|
||||
CellPngDecSubHandle* subHandle_data;
|
||||
if(!cellPngDec.CheckId(subHandle, subHandle_data))
|
||||
|
@ -234,6 +243,9 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
|||
|
||||
int cellPngDecSetParameter(u32 mainHandle, u32 subHandle, const mem_ptr_t<CellPngDecInParam> inParam, mem_ptr_t<CellPngDecOutParam> outParam)
|
||||
{
|
||||
if (!inParam.IsGood() || !outParam.IsGood())
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
|
||||
CellPngDecSubHandle* subHandle_data;
|
||||
if(!cellPngDec.CheckId(subHandle, subHandle_data))
|
||||
return CELL_PNGDEC_ERROR_FATAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue