From ffebb919101120feb55cef43bf48e1d142693ebf Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 12 Jun 2017 14:36:36 -0500 Subject: [PATCH] winemp3.acm: Fix error in acmStreamSize(). Signed-off-by: Zebediah Figura Signed-off-by: Andrew Eikum Signed-off-by: Alexandre Julliard --- dlls/winemp3.acm/mpegl3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/winemp3.acm/mpegl3.c b/dlls/winemp3.acm/mpegl3.c index cc6008da59e..13a6109a77a 100644 --- a/dlls/winemp3.acm/mpegl3.c +++ b/dlls/winemp3.acm/mpegl3.c @@ -940,11 +940,11 @@ static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ad adsi->pwfxDst->wFormatTag == WAVE_FORMAT_MPEG)) { nblocks = adss->cbSrcLength / (adsi->pwfxSrc->nBlockAlign * 1152); - if (nblocks == 0) - return ACMERR_NOTPOSSIBLE; if (adss->cbSrcLength % (DWORD)(adsi->pwfxSrc->nBlockAlign * 1152)) /* Round block count up. */ nblocks++; + if (nblocks == 0) + return ACMERR_NOTPOSSIBLE; adss->cbDstLength = 3000 + nblocks * (DWORD)(adsi->pwfxDst->nAvgBytesPerSec * 1152 / adsi->pwfxDst->nSamplesPerSec + 0.5); } else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEGLAYER3 || @@ -952,11 +952,11 @@ static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ad adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { nblocks = adss->cbSrcLength / (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec); - if (nblocks == 0) - return ACMERR_NOTPOSSIBLE; if (adss->cbSrcLength % (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec)) /* Round block count up. */ nblocks++; + if (nblocks == 0) + return ACMERR_NOTPOSSIBLE; adss->cbDstLength = nblocks * 1152 * adsi->pwfxDst->nBlockAlign; } else