msadpcm32.acm: Stop converting data instead of crashing.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
This commit is contained in:
parent
972a74ddfe
commit
72528be84f
|
@ -249,9 +249,17 @@ static void cvtSSms16K(const ACMDRVSTREAMINSTANCE *adsi,
|
|||
{
|
||||
const unsigned char* in_src = src;
|
||||
|
||||
assert(*src <= 6);
|
||||
/* Catch a problem from Tomb Raider III (bug 21000) where it passes
|
||||
* invalid data after a valid sequence of blocks */
|
||||
if (*src > 6 || *(src + 1) > 6)
|
||||
{
|
||||
/* Recalculate the amount of used output buffer. We are not changing
|
||||
* nsrc, let's assume the bad data was parsed */
|
||||
*ndst -= nblock * nsamp_blk * adsi->pwfxDst->nBlockAlign;
|
||||
WARN("Invalid ADPCM data, stopping conversion\n");
|
||||
break;
|
||||
}
|
||||
coeffL = MSADPCM_CoeffSet[*src++];
|
||||
assert(*src <= 6);
|
||||
coeffR = MSADPCM_CoeffSet[*src++];
|
||||
|
||||
ideltaL = R16(src); src += 2;
|
||||
|
|
Loading…
Reference in New Issue