Commit 14db7003 authored by Jeff Zaroyko's avatar Jeff Zaroyko Committed by Alexandre Julliard

dsound: Check for invalid parameter when unlocking primary buffers.

parent 73393fab
......@@ -1000,7 +1000,11 @@ static HRESULT WINAPI PrimaryBufferImpl_Unlock(
if (!(device->drvdesc.dwFlags & DSDDESC_DONTNEEDPRIMARYLOCK) && device->hwbuf) {
HRESULT hres;
if ((char *)p1 - (char *)device->buffer + x1 > device->buflen)
hres = DSERR_INVALIDPARAM;
else
hres = IDsDriverBuffer_Unlock(device->hwbuf, p1, x1, p2, x2);
if (hres != DS_OK) {
WARN("IDsDriverBuffer_Unlock failed\n");
return hres;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment