mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-16 09:31:14 +00:00
- reject all DMX sounds shorter than or equal 8 bytes.
8 bytes is the minimum header size for DMX, so for one byte of sample data it has to be 9 bytes. This was causing access to invalid memory when trying to read the header of something too short. For other file formats this is of no concern because none has a header this short.
This commit is contained in:
parent
d1ec7c8cfd
commit
06f84d2420
1 changed files with 2 additions and 2 deletions
|
@ -1498,7 +1498,7 @@ sfxinfo_t *S_LoadSound(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer)
|
|||
DPrintf(DMSG_NOTIFY, "Loading sound \"%s\" (%td)\n", sfx->name.GetChars(), sfx - &S_sfx[0]);
|
||||
|
||||
int size = Wads.LumpLength(sfx->lumpnum);
|
||||
if (size > 0)
|
||||
if (size > 8)
|
||||
{
|
||||
auto wlump = Wads.OpenLumpReader(sfx->lumpnum);
|
||||
auto sfxdata = wlump.Read(size);
|
||||
|
@ -1564,7 +1564,7 @@ static void S_LoadSound3D(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer)
|
|||
else
|
||||
{
|
||||
int size = Wads.LumpLength(sfx->lumpnum);
|
||||
if (size <= 0) return;
|
||||
if (size <= 8) return;
|
||||
|
||||
auto wlump = Wads.OpenLumpReader(sfx->lumpnum);
|
||||
auto sfxdata = wlump.Read(size);
|
||||
|
|
Loading…
Reference in a new issue