[Bug 42546] DSOUND_PrimaryOpen() incorrect set buf size

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Feb 28 05:39:25 CST 2017


https://bugs.winehq.org/show_bug.cgi?id=42546

--- Comment #5 from Ivan_83 <rozhuk.im at gmail.com> ---
Yes, I will try it.

But this patch will allocate less then:
new_buflen = ((frames + 1) * wfx->nBlockAlign * sizeof(float));
and
new_buflen = (frames  * sizeof(float)); - I have test it and it cause crash.

wfx->nBlockAlign - in most cases I see =2, sizeof(float)=4.
And it does not change:
    device->fraglen = frag_frames * wfx->nBlockAlign;
    device->aclen = aclen_frames * wfx->nBlockAlign;
so device->fraglen and device->aclen will be bigger (in some cases) than
device->buflen and allocated mem size.
Next, device->fraglen and device->aclen will be used some where and corrupt
heap...again.

IMHO, refactoring needed and DSOUND_PrimaryOpen() should be included into
DSOUND_ReopenDevice() and all sizes should be calculated and set in ONE(!!!)
place.
All playing with patch DSOUND_PrimaryOpen() is waste of time.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list