From f5d183e20eefc041e118da4c37e3465a6ba9583f Mon Sep 17 00:00:00 2001 From: Bruno Jesus <00cpxxx@gmail.com> Date: Wed, 9 Sep 2015 12:10:21 +0800 Subject: [PATCH] msadp32.acm: Ensure we have enough memory before memcopying data. --- dlls/msadp32.acm/msadp32.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/msadp32.acm/msadp32.c b/dlls/msadp32.acm/msadp32.c index 83d1b464964..2c615756414 100644 --- a/dlls/msadp32.acm/msadp32.c +++ b/dlls/msadp32.acm/msadp32.c @@ -542,6 +542,8 @@ static LRESULT ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs) if (ADPCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE; break; case WAVE_FORMAT_ADPCM: + if (adfs->cbwfxDst < sizeof(ADPCMWAVEFORMAT) + (7 - 1) * sizeof(ADPCMCOEFSET)) + return ACMERR_NOTPOSSIBLE; init_wfx_adpcm((ADPCMWAVEFORMAT*)adfs->pwfxDst); /* check if result is ok */ if (ADPCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;