Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f1405ca0
Commit
f1405ca0
authored
Dec 04, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Dec 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Accept GIF files with no trailer.
parent
b49cc566
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
1 deletion
+70
-1
bmpformat.c
dlls/windowscodecs/tests/bmpformat.c
+66
-0
ungif.c
dlls/windowscodecs/ungif.c
+4
-1
No files found.
dlls/windowscodecs/tests/bmpformat.c
View file @
f1405ca0
...
...
@@ -1034,6 +1034,71 @@ static void test_createfromstream(void)
IWICImagingFactory_Release
(
factory
);
}
/* 1x1 pixel gif, missing trailer */
static
unsigned
char
gifimage_notrailer
[]
=
{
0x47
,
0x49
,
0x46
,
0x38
,
0x37
,
0x61
,
0x01
,
0x00
,
0x01
,
0x00
,
0x80
,
0x00
,
0x00
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0x2c
,
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x01
,
0x00
,
0x00
,
0x02
,
0x02
,
0x44
,
0x01
,
0x00
};
static
void
test_gif_notrailer
(
void
)
{
IWICBitmapDecoder
*
decoder
;
IWICImagingFactory
*
factory
;
HRESULT
hr
;
IWICStream
*
gifstream
;
IWICBitmapFrameDecode
*
framedecode
;
UINT
framecount
;
hr
=
CoCreateInstance
(
&
CLSID_WICImagingFactory
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICImagingFactory
,
(
void
**
)
&
factory
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed, hr=%x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
hr
=
IWICImagingFactory_CreateStream
(
factory
,
&
gifstream
);
ok
(
hr
==
S_OK
,
"CreateStream failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICStream_InitializeFromMemory
(
gifstream
,
gifimage_notrailer
,
sizeof
(
gifimage_notrailer
));
ok
(
hr
==
S_OK
,
"InitializeFromMemory failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
CoCreateInstance
(
&
CLSID_WICGifDecoder
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICBitmapDecoder
,
(
void
**
)
&
decoder
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed, hr=%x
\n
"
,
hr
);
}
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapDecoder_Initialize
(
decoder
,
(
IStream
*
)
gifstream
,
WICDecodeMetadataCacheOnDemand
);
ok
(
hr
==
S_OK
,
"Initialize failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapDecoder_GetFrame
(
decoder
,
0
,
&
framedecode
);
ok
(
hr
==
S_OK
,
"GetFrame failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IWICBitmapFrameDecode_Release
(
framedecode
);
}
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapDecoder_GetFrameCount
(
decoder
,
&
framecount
);
ok
(
hr
==
S_OK
,
"GetFrameCount failed, hr=%x
\n
"
,
hr
);
ok
(
framecount
==
1
,
"framecount=%u
\n
"
,
framecount
);
}
IWICBitmapDecoder_Release
(
decoder
);
}
IWICStream_Release
(
gifstream
);
}
IWICImagingFactory_Release
(
factory
);
}
START_TEST
(
bmpformat
)
{
CoInitializeEx
(
NULL
,
COINIT_APARTMENTTHREADED
);
...
...
@@ -1045,6 +1110,7 @@ START_TEST(bmpformat)
test_decode_rle4
();
test_componentinfo
();
test_createfromstream
();
test_gif_notrailer
();
CoUninitialize
();
}
dlls/windowscodecs/ungif.c
View file @
f1405ca0
...
...
@@ -320,7 +320,10 @@ DGifGetRecordType(GifFileType * GifFile,
GifByteType
Buf
;
if
(
READ
(
GifFile
,
&
Buf
,
1
)
!=
1
)
{
return
GIF_ERROR
;
/* Wine-specific behavior: Native accepts broken GIF files that have no
* terminator, so we match this by treating EOF as a terminator. */
*
Type
=
TERMINATE_RECORD_TYPE
;
return
GIF_OK
;
}
switch
(
Buf
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment