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

This commit is contained in:
Dmitry Timoshkov 2014-04-10 17:03:17 +09:00 committed by Alexandre Julliard
parent f20045c28e
commit 5fc94f0adc
2 changed files with 6 additions and 3 deletions

View File

@ -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 */

View File

@ -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)
{