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
3caf7204
Commit
3caf7204
authored
Apr 09, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add locking to the GIF decoder.
parent
c1beb636
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
gifformat.c
dlls/windowscodecs/gifformat.c
+20
-2
regsvr.c
dlls/windowscodecs/regsvr.c
+1
-1
No files found.
dlls/windowscodecs/gifformat.c
View file @
3caf7204
...
...
@@ -40,6 +40,7 @@ typedef struct {
LONG
ref
;
BOOL
initialized
;
GifFileType
*
gif
;
CRITICAL_SECTION
lock
;
}
GifDecoder
;
typedef
struct
{
...
...
@@ -302,6 +303,8 @@ static ULONG WINAPI GifDecoder_Release(IWICBitmapDecoder *iface)
if
(
ref
==
0
)
{
This
->
lock
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
lock
);
DGifCloseFile
(
This
->
gif
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -341,9 +344,12 @@ static HRESULT WINAPI GifDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
TRACE
(
"(%p,%p,%x)
\n
"
,
iface
,
pIStream
,
cacheOptions
);
EnterCriticalSection
(
&
This
->
lock
);
if
(
This
->
initialized
||
This
->
gif
)
{
WARN
(
"already initialized
\n
"
);
LeaveCriticalSection
(
&
This
->
lock
);
return
WINCODEC_ERR_WRONGSTATE
;
}
...
...
@@ -353,16 +359,26 @@ static HRESULT WINAPI GifDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
/* read all data from the stream */
This
->
gif
=
DGifOpen
((
void
*
)
pIStream
,
_gif_inputfunc
);
if
(
!
This
->
gif
)
return
E_FAIL
;
if
(
!
This
->
gif
)
{
LeaveCriticalSection
(
&
This
->
lock
);
return
E_FAIL
;
}
ret
=
DGifSlurp
(
This
->
gif
);
if
(
ret
==
GIF_ERROR
)
return
E_FAIL
;
if
(
ret
==
GIF_ERROR
)
{
LeaveCriticalSection
(
&
This
->
lock
);
return
E_FAIL
;
}
/* make sure we don't use the stream after this method returns */
This
->
gif
->
UserData
=
NULL
;
This
->
initialized
=
TRUE
;
LeaveCriticalSection
(
&
This
->
lock
);
return
S_OK
;
}
...
...
@@ -502,6 +518,8 @@ HRESULT GifDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
This
->
ref
=
1
;
This
->
initialized
=
FALSE
;
This
->
gif
=
NULL
;
InitializeCriticalSection
(
&
This
->
lock
);
This
->
lock
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": GifDecoder.lock"
);
ret
=
IUnknown_QueryInterface
((
IUnknown
*
)
This
,
iid
,
ppv
);
IUnknown_Release
((
IUnknown
*
)
This
);
...
...
dlls/windowscodecs/regsvr.c
View file @
3caf7204
...
...
@@ -757,7 +757,7 @@ static struct regsvr_coclass const coclass_list[] = {
"WIC GIF Decoder"
,
NULL
,
"windowscodecs.dll"
,
"
Apartment
"
"
Both
"
},
{
&
CLSID_WICIcoDecoder
,
"WIC ICO Decoder"
,
...
...
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