msadp32: Must refuse unknown destination format hint

William Waghorn willw at litany.me.uk
Thu Feb 26 21:12:48 CST 2009


ADPCM_FormatSuggest must check that destination format hint is
WAVE_FORMAT_PCM or WAVE_FORMAT_ADPCM.
---
 dlls/msadp32.acm/msadp32.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/dlls/msadp32.acm/msadp32.c b/dlls/msadp32.acm/msadp32.c
index 1c0c840..fd26f68 100644
--- a/dlls/msadp32.acm/msadp32.c
+++ b/dlls/msadp32.acm/msadp32.c
@@ -476,6 +476,17 @@ static	LRESULT
ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
 	ADPCM_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) return
ACMERR_NOTPOSSIBLE;
     /* FIXME: should do those tests against the real size (according to
format tag */

+    if (adfs->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG)
+    {
+	switch (adfs->pwfxDst->wFormatTag) {
+	    case WAVE_FORMAT_PCM:
+	    case WAVE_FORMAT_ADPCM:
+		break;
+	    default:
+		return ACMERR_NOTPOSSIBLE;
+	}
+    }
+
     /* If no suggestion for destination, then copy source value */
     if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NCHANNELS))
 	adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels;
-- 
1.5.6.5




More information about the wine-patches mailing list