Fix incorrect read length in D1 piggy_read_sounds
Reported-by: Kreeblah <https://github.com/dxx-rebirth/dxx-rebirth/issues/542>
Fixes: faf37e3c14
("Always allocate D2-sized sound array")
This commit is contained in:
parent
969caa8c0c
commit
9c5f7b1248
|
@ -1189,7 +1189,10 @@ void piggy_read_sounds(int pc_shareware)
|
|||
// hack for Mac Demo
|
||||
if (auto array = PHYSFSX_openReadBuffered(soundfile))
|
||||
{
|
||||
if (PHYSFS_read(array, Sounds, Sounds.size(), 1) != 1) // make the 'Sounds' index array match with the sounds we're about to read in
|
||||
/* Sounds.size() is the D2-compatible size, but this
|
||||
* statement must read a D1 length, so use MAX_SOUNDS.
|
||||
*/
|
||||
if (PHYSFS_read(array, Sounds, MAX_SOUNDS, 1) != 1) // make the 'Sounds' index array match with the sounds we're about to read in
|
||||
{
|
||||
con_printf(CON_URGENT,"Warning: Can't read Sounds/sounds.array: %s", PHYSFS_getLastError());
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue