Commit a0bc2bd9 authored by Andrew Nguyen's avatar Andrew Nguyen Committed by Alexandre Julliard

windowscodecs: Avoid writing to the output pointer on failure in…

windowscodecs: Avoid writing to the output pointer on failure in StreamOnStreamRange::Read and StreamOnStreamRange::Write.
parent 70d67bec
......@@ -371,7 +371,7 @@ static HRESULT WINAPI StreamOnStreamRange_Read(IStream *iface,
This->pos.QuadPart += uBytesRead;
LeaveCriticalSection(&This->lock);
if (pcbRead) *pcbRead = uBytesRead;
if (SUCCEEDED(hr) && pcbRead) *pcbRead = uBytesRead;
return hr;
}
......@@ -414,7 +414,7 @@ static HRESULT WINAPI StreamOnStreamRange_Write(IStream *iface,
This->pos.QuadPart += uBytesWritten;
LeaveCriticalSection(&This->lock);
if (pcbWritten) *pcbWritten = uBytesWritten;
if (SUCCEEDED(hr) && pcbWritten) *pcbWritten = uBytesWritten;
return hr;
}
......
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