Viktor Semykin : windowscodecs/tests: Test for png codec seeking too far.

Alexandre Julliard julliard at winehq.org
Mon Apr 3 14:01:46 CDT 2017


Module: wine
Branch: master
Commit: 5ada4e947ebeee3bf30e1b211dc045e5f5d9eeab
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5ada4e947ebeee3bf30e1b211dc045e5f5d9eeab

Author: Viktor Semykin <thesame.ml at gmail.com>
Date:   Thu Mar 30 13:52:12 2017 -0300

windowscodecs/tests: Test for png codec seeking too far.

Signed-off-by: Viktor Semykin <thesame.ml at gmail.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/windowscodecs/tests/pngformat.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dlls/windowscodecs/tests/pngformat.c b/dlls/windowscodecs/tests/pngformat.c
index 34cb533..e9a0c18 100644
--- a/dlls/windowscodecs/tests/pngformat.c
+++ b/dlls/windowscodecs/tests/pngformat.c
@@ -284,6 +284,8 @@ static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size
     IStream *stream;
     GUID format;
     LONG refcount;
+    ULARGE_INTEGER pos;
+    LARGE_INTEGER zero;
 
     hmem = GlobalAlloc(0, image_size);
     data = GlobalLock(hmem);
@@ -302,6 +304,11 @@ static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size
     ok(IsEqualGUID(&format, &GUID_ContainerFormatPng),
        "wrong container format %s\n", wine_dbgstr_guid(&format));
 
+    zero.QuadPart = 0;
+    IStream_Seek (stream, zero, STREAM_SEEK_CUR, &pos);
+    todo_wine ok(pos.QuadPart < image_size, "seek beyond the end of stream: %x%08x >= %x\n",
+       (UINT)(pos.QuadPart >> 32), (UINT)pos.QuadPart, image_size);
+
     refcount = IStream_Release(stream);
     ok(refcount > 0, "expected stream refcount > 0\n");
 




More information about the wine-cvs mailing list