msadp32.acm: Ensure we have enough memory before memcopying data.

This commit is contained in:
Bruno Jesus 2015-09-09 12:10:21 +08:00 committed by Alexandre Julliard
parent 4e01388a32
commit f5d183e20e
1 changed files with 2 additions and 0 deletions

View File

@ -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;