[PATCH 05/12] msadp32.acm: Remove unnecessary checks.

Zebediah Figura z.figura12 at gmail.com
Tue Jun 6 15:14:54 CDT 2017


These are already checked in msacm32 or not checked on Windows.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/msacm32/tests/msacm.c |  1 -
 dlls/msadp32.acm/msadp32.c | 11 +----------
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/dlls/msacm32/tests/msacm.c b/dlls/msacm32/tests/msacm.c
index eae79d92b1..930c06c4c1 100644
--- a/dlls/msacm32/tests/msacm.c
+++ b/dlls/msacm32/tests/msacm.c
@@ -206,7 +206,6 @@ static BOOL CALLBACK FormatTagEnumProc(HACMDRIVERID hadid,
             fd.cbwfx = sizeof(PCMWAVEFORMAT);
             fd.pwfx->cbSize = 0xbeef;
             rc = acmFormatDetailsA(had, &fd, ACM_FORMATDETAILSF_INDEX);
-            todo_wine_if(rc != MMSYSERR_NOERROR) /* remove when fixed */
             ok(rc == MMSYSERR_NOERROR,
                "acmFormatDetailsA(): rc = %08x, should be %08x\n",
                rc, MMSYSERR_NOERROR);
diff --git a/dlls/msadp32.acm/msadp32.c b/dlls/msadp32.acm/msadp32.c
index 24e0c6a72b..c8cc792068 100644
--- a/dlls/msadp32.acm/msadp32.c
+++ b/dlls/msadp32.acm/msadp32.c
@@ -470,7 +470,6 @@ static	LRESULT	ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
 	switch (afd->dwFormatTag)
         {
 	case WAVE_FORMAT_PCM:
-	    if (afd->dwFormatIndex >= NUM_PCM_FORMATS) return ACMERR_NOTPOSSIBLE;
 	    afd->pwfx->nChannels = PCM_Formats[afd->dwFormatIndex].nChannels;
 	    afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate;
 	    afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits;
@@ -483,9 +482,6 @@ static	LRESULT	ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
 		afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign;
 	    break;
 	case WAVE_FORMAT_ADPCM:
-	    if (afd->dwFormatIndex >= NUM_ADPCM_FORMATS) return ACMERR_NOTPOSSIBLE;
-            if (afd->cbwfx < sizeof(ADPCMWAVEFORMAT) + (7 - 1) * sizeof(ADPCMCOEFSET))
-                return ACMERR_NOTPOSSIBLE;
 	    afd->pwfx->nChannels = ADPCM_Formats[afd->dwFormatIndex].nChannels;
 	    afd->pwfx->nSamplesPerSec = ADPCM_Formats[afd->dwFormatIndex].rate;
 	    afd->pwfx->wBitsPerSample = ADPCM_Formats[afd->dwFormatIndex].nBits;
@@ -513,11 +509,8 @@ static	LRESULT	ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
 static	LRESULT	ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
 {
     /* some tests ... */
-    if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) ||
-	adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) ||
-	adfs->pwfxSrc->wFormatTag == adfs->pwfxDst->wFormatTag ||
+    if (adfs->pwfxSrc->wFormatTag == adfs->pwfxDst->wFormatTag ||
 	ADPCM_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
-    /* FIXME: should do those tests against the real size (according to format tag */
 
     /* If no suggestion for destination, then copy source value */
     if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NCHANNELS))
@@ -550,8 +543,6 @@ 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;
-- 
2.13.0




More information about the wine-patches mailing list