Module: wine Branch: master Commit: 5fc94f0adc8c9e2ec54f4ff5935aaf9b6cd44b4d URL: http://source.winehq.org/git/wine.git/?a=commit;h=5fc94f0adc8c9e2ec54f4ff593...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Thu Apr 10 17:03:17 2014 +0900
oleaut32: Fix loading of an empty picture from a non-statable stream.
---
dlls/oleaut32/olepicture.c | 7 ++++++- dlls/oleaut32/tests/olepicture.c | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index 6e4a737..599042c 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -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 */ diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index 6861603..46dd05f 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -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) {