1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00

msadpm: Stop decoding instead of crashing for invalid adpcm data.

Apply the same patch from 72528be84f for adpcm data sent to mono
destinations in addition to stereo destinations.

Signed-off-by: Brandon Moore <moore.3071@osu.edu>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Brandon Moore 2022-04-29 16:50:55 -07:00 committed by Alexandre Julliard
parent 7a32bc9e32
commit 63f9a08240

View File

@ -319,7 +319,14 @@ static void cvtMMms16K(const ACMDRVSTREAMINSTANCE *adsi,
{
const unsigned char* in_src = src;
assert(*src <= 6);
/* Catch a problem from Lord of the Rings War of the Ring where it
* passes invalid data. */
if (*src > 6)
{
*ndst -= nblock * nsamp_blk * adsi->pwfxDst->nBlockAlign;
WARN("Invalid ADPCM data, stopping conversion\n");
break;
}
coeff = MSADPCM_CoeffSet[*src++];
idelta = R16(src); src += 2;