[codec,ncrush] fix missing input length check

This commit is contained in:
akallabeth 2024-04-16 08:45:03 +02:00 committed by Martin Fleisz
parent 9da3f23698
commit 91a1535f88

View File

@ -2068,6 +2068,12 @@ int ncrush_decompress(NCRUSH_CONTEXT* ncrush, const BYTE* pSrcData, UINT32 SrcSi
return 1;
}
if (SrcSize < 4)
{
WLog_ERR(TAG, "Input size short: SrcSize %" PRIu32 " < 4", SrcSize);
return -1;
}
const BYTE* SrcEnd = &pSrcData[SrcSize];
const BYTE* SrcPtr = pSrcData + 4;