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

Signed-off-by: Viktor Semykin <thesame.ml@gmail.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Viktor Semykin 2017-03-30 13:52:12 -03:00 committed by Alexandre Julliard
parent a68e51ce63
commit 5ada4e947e
1 changed files with 7 additions and 0 deletions

View File

@ -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");