[PATCH] msacm32: Fix bytes written in PCM converter.

Andrew Eikum aeikum at codeweavers.com
Mon Jun 12 09:16:28 CDT 2017


On Mon, Jun 12, 2017 at 09:05:22AM -0500, z.figura12 at gmail.com wrote:
> On 06/12/2017 08:08 AM, Andrew Eikum wrote:
> >On Tue, Jun 06, 2017 at 06:17:46PM -0500, Zebediah Figura wrote:
> >>diff --git a/dlls/msacm32/pcmconverter.c b/dlls/msacm32/pcmconverter.c
> >>index e4bc5e7777..51f5eec8ee 100644
> >>--- a/dlls/msacm32/pcmconverter.c
> >>+++ b/dlls/msacm32/pcmconverter.c
> >>@@ -561,6 +561,7 @@ static	void cvtSS88C(DWORD srcRate, const unsigned char* src, LPDWORD nsrc,
> >>              error = error - dstRate;
> >>          }
> >>      }
> >>+    *ndst = 0;
> >>  }
> >
> >I'm confused how this makes a difference. Isn't ndst already 0 at this
> >point since it exited the while loop?
> >
> >Andrew
> >
> 
> It exited the while loop while nsrc still > 0, and since it is
> post-decremented, it exits with a value of -1.

Ah, right. Those operators are way more trouble than they're worth.

Would you be opposed to rewriting the loops to be more readable?
Expecting *ndst to wrap around and then be fixed later feels like the
wrong solution. You could use a for-loop or something.

Andrew



More information about the wine-devel mailing list