msxml3: Add error handling when reading from IStream.

This commit is contained in:
Piotr Caban 2008-08-20 18:32:02 +02:00 committed by Alexandre Julliard
parent 655155feb8
commit 126c0abeef
1 changed files with 19 additions and 0 deletions

View File

@ -1876,8 +1876,20 @@ static HRESULT WINAPI internal_parse(
if(hr == E_PENDING) continue;
break;
}
if(hr != S_OK)
{
IStream_Release(stream);
break;
}
data = HeapAlloc(GetProcessHeap(), 0,
dataInfo.cbSize.QuadPart);
if(!data)
{
IStream_Release(stream);
break;
}
while(1)
{
hr = IStream_Read(stream, data,
@ -1885,6 +1897,13 @@ static HRESULT WINAPI internal_parse(
if(hr == E_PENDING) continue;
break;
}
if(hr != S_OK)
{
HeapFree(GetProcessHeap(), 0, data);
IStream_Release(stream);
break;
}
hr = internal_parseBuffer(This, data,
dataInfo.cbSize.QuadPart, vbInterface);
HeapFree(GetProcessHeap(), 0, data);