Skip to content

Commit c9b5272

Browse files
dewi-timclaude
andcommitted
Fix reversed bounds check in Cmd_PcmRamWrite
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent df8bccb commit c9b5272

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

player/vgmplayer_cmdhandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ void VGMPlayer::Cmd_PcmRamWrite(void)
821821
const UINT8* ROMData = &_pcmBank[dbType].data[dbPos];
822822
if (! dataLen)
823823
dataLen += 0x01000000;
824-
if (_pcmBank[dbType].data.size() - dbPos > dataLen)
824+
if (dataLen > _pcmBank[dbType].data.size() - dbPos)
825825
return; // just outright ignore writes that would go out-of-bounds
826826

827827
if (chipType == 0x14) // NES APU

0 commit comments

Comments
 (0)