Commit 8e88af31 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msacm32: Add more invalid parameter checks for acmFormatSuggest().

parent 1e30f79b
......@@ -719,6 +719,7 @@ MMRESULT WINAPI acmFormatEnumW(HACMDRIVER had, PACMFORMATDETAILSW pafd,
MMRESULT WINAPI acmFormatSuggest(HACMDRIVER had, PWAVEFORMATEX pwfxSrc,
PWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest)
{
ACMFORMATTAGDETAILSW aftd = {0};
ACMDRVFORMATSUGGEST adfg;
MMRESULT mmr;
......@@ -732,6 +733,16 @@ MMRESULT WINAPI acmFormatSuggest(HACMDRIVER had, PWAVEFORMATEX pwfxSrc,
ACM_FORMATSUGGESTF_WBITSPERSAMPLE|ACM_FORMATSUGGESTF_WFORMATTAG))
return MMSYSERR_INVALFLAG;
aftd.cbStruct = sizeof(aftd);
if (fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG)
aftd.dwFormatTag = pwfxDst->wFormatTag;
mmr = acmFormatTagDetailsW(had, &aftd, ACM_FORMATTAGDETAILSF_LARGESTSIZE);
if ((fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG) && mmr == ACMERR_NOTPOSSIBLE)
return ACMERR_NOTPOSSIBLE;
if (cbwfxDst < aftd.cbFormatSize)
return MMSYSERR_INVALPARAM;
adfg.cbStruct = sizeof(adfg);
adfg.fdwSuggest = fdwSuggest;
adfg.pwfxSrc = pwfxSrc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment