zgfx: add a check

This commit is contained in:
David Fort 2017-12-22 17:55:48 +01:00
parent 7c3d75bf1d
commit 5e2d6ea029

View File

@ -317,7 +317,10 @@ int zgfx_decompress(ZGFX_CONTEXT* zgfx, const BYTE* pSrcData, UINT32 SrcSize, BY
{
int status = -1;
BYTE descriptor;
wStream* stream = Stream_New((BYTE*)pSrcData, SrcSize);
if (!stream)
return -1;
if (Stream_GetRemainingLength(stream) < 1)
goto fail;