From: Zebediah Figura Subject: [PATCH 05/12] msadp32.acm: Remove unnecessary checks. Message-Id: <20170606201501.6502-5-z.figura12@gmail.com> Date: Tue, 6 Jun 2017 15:14:54 -0500 In-Reply-To: <20170606201501.6502-1-z.figura12@gmail.com> References: <20170606201501.6502-1-z.figura12@gmail.com> These are already checked in msacm32 or not checked on Windows. Signed-off-by: Zebediah Figura --- 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