make invalid IMA not crash, just sound lousy

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@223 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
halleyscometsw 2008-06-12 23:51:16 +00:00
parent 933053a1bb
commit 453e5c148f

View File

@ -80,6 +80,8 @@ void decode_xbox_ima(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspac
if (first_sample == 0) {
hist1 = read_16bitLE(offset+channel*4,stream->streamfile);
step_index = read_16bitLE(offset+channel*4+2,stream->streamfile);
if (step_index < 0) step_index=0;
if (step_index > 88) step_index=88;
}
for (i=first_sample,sample_count=0; i<first_sample+samples_to_do; i++,sample_count+=channelspacing) {