oleaut32: Fix loading of an empty picture from a non-statable stream.
This commit is contained in:
parent
f20045c28e
commit
5fc94f0adc
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue