Commit 5fc94f0a authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

oleaut32: Fix loading of an empty picture from a non-statable stream.

parent f20045c2
......@@ -1390,12 +1390,17 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface, IStream *pStm)
}
headerread += xread;
xread = 0;
if (!memcmp(&(header[0]),"lt\0\0", 4) && (statfailed || (header[1] + headerread <= statstg.cbSize.QuadPart))) {
if (toread != 0 && toread != header[1])
FIXME("varying lengths of image data (prev=%u curr=%u), only last one will be used\n",
toread, header[1]);
toread = header[1];
if (statfailed)
{
statstg.cbSize.QuadPart = header[1] + 8;
statfailed = FALSE;
}
if (toread == 0) break;
} else {
if (!memcmp(&(header[0]), "GIF8", 4) || /* GIF header */
......
......@@ -1226,9 +1226,7 @@ static void test_load_save_empty_picture(void)
pic = NULL;
hr = pOleLoadPicture(stream, 0, FALSE, &IID_IPicture, (void **)&pic);
todo_wine
ok(hr == S_OK, "OleLoadPicture error %#x\n", hr);
todo_wine
ok(pic != NULL,"picture should not be not NULL\n");
if (pic != NULL)
{
......
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