Fixed playptmod checking for ADPCM samples

CQTexperiment
Chris Moeller 2013-10-29 11:09:51 -07:00
parent ee5821b45d
commit 240d7ae8ff
1 changed files with 2 additions and 1 deletions

View File

@ -1333,12 +1333,13 @@ int playptmod_LoadMem(void *_p, const unsigned char *buf, unsigned long bufLengt
s->offset = sampleOffset;
j = (s->length + 1) / 2 + 5 + 16;
if ( j > s->length ) j = s->length;
bufread(tempSample, 1, j, fmodule);
smpDat8 = tempSample;
if (s->length > 5 && memcmp(smpDat8, "ADPCM", 5) == 0)
if (j > 5 + 16 && memcmp(smpDat8, "ADPCM", 5) == 0)
{
s->reallength = j;
}