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
61de79dc
Commit
61de79dc
authored
Feb 09, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/animate: Use the global HeapAlloc() helpers.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bd4193ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
30 deletions
+34
-30
animate.c
dlls/comctl32/animate.c
+34
-30
No files found.
dlls/comctl32/animate.c
View file @
61de79dc
...
...
@@ -45,6 +45,7 @@
#include "mmsystem.h"
#include "comctl32.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
animate
);
...
...
@@ -188,36 +189,39 @@ static BOOL ANIMATE_DoStop(ANIMATE_INFO *infoPtr)
static
void
ANIMATE_Free
(
ANIMATE_INFO
*
infoPtr
)
{
if
(
infoPtr
->
hMMio
)
{
ANIMATE_DoStop
(
infoPtr
);
mmioClose
(
infoPtr
->
hMMio
,
0
);
if
(
infoPtr
->
hRes
)
{
FreeResource
(
infoPtr
->
hRes
);
infoPtr
->
hRes
=
0
;
}
Free
(
infoPtr
->
lpIndex
);
if
(
infoPtr
->
hMMio
)
{
ANIMATE_DoStop
(
infoPtr
);
mmioClose
(
infoPtr
->
hMMio
,
0
);
if
(
infoPtr
->
hRes
)
{
FreeResource
(
infoPtr
->
hRes
);
infoPtr
->
hRes
=
0
;
}
heap_free
(
infoPtr
->
lpIndex
);
infoPtr
->
lpIndex
=
NULL
;
if
(
infoPtr
->
hic
)
{
fnIC
.
fnICClose
(
infoPtr
->
hic
);
infoPtr
->
hic
=
0
;
}
Free
(
infoPtr
->
inbih
);
if
(
infoPtr
->
hic
)
{
fnIC
.
fnICClose
(
infoPtr
->
hic
);
infoPtr
->
hic
=
0
;
}
heap_free
(
infoPtr
->
inbih
);
infoPtr
->
inbih
=
NULL
;
F
ree
(
infoPtr
->
outbih
);
heap_f
ree
(
infoPtr
->
outbih
);
infoPtr
->
outbih
=
NULL
;
F
ree
(
infoPtr
->
indata
);
heap_f
ree
(
infoPtr
->
indata
);
infoPtr
->
indata
=
NULL
;
F
ree
(
infoPtr
->
outdata
);
heap_f
ree
(
infoPtr
->
outdata
);
infoPtr
->
outdata
=
NULL
;
if
(
infoPtr
->
hbmPrevFrame
)
if
(
infoPtr
->
hbmPrevFrame
)
{
DeleteObject
(
infoPtr
->
hbmPrevFrame
);
DeleteObject
(
infoPtr
->
hbmPrevFrame
);
infoPtr
->
hbmPrevFrame
=
0
;
}
memset
(
&
infoPtr
->
mah
,
0
,
sizeof
(
infoPtr
->
mah
));
memset
(
&
infoPtr
->
ash
,
0
,
sizeof
(
infoPtr
->
ash
));
infoPtr
->
nFromFrame
=
infoPtr
->
nToFrame
=
infoPtr
->
nLoop
=
infoPtr
->
currFrame
=
0
;
memset
(
&
infoPtr
->
mah
,
0
,
sizeof
(
infoPtr
->
mah
));
memset
(
&
infoPtr
->
ash
,
0
,
sizeof
(
infoPtr
->
ash
));
infoPtr
->
nFromFrame
=
infoPtr
->
nToFrame
=
infoPtr
->
nLoop
=
infoPtr
->
currFrame
=
0
;
}
infoPtr
->
transparentColor
=
ANIMATE_COLOR_NONE
;
}
...
...
@@ -571,7 +575,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
return
FALSE
;
}
infoPtr
->
inbih
=
Alloc
(
mmckInfo
.
cksize
);
infoPtr
->
inbih
=
heap_alloc_zero
(
mmckInfo
.
cksize
);
if
(
!
infoPtr
->
inbih
)
{
WARN
(
"Can't alloc input BIH
\n
"
);
return
FALSE
;
...
...
@@ -618,7 +622,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
/* FIXME: should handle the 'rec ' LIST when present */
infoPtr
->
lpIndex
=
Alloc
(
infoPtr
->
mah
.
dwTotalFrames
*
sizeof
(
DWORD
));
infoPtr
->
lpIndex
=
heap_alloc_zero
(
infoPtr
->
mah
.
dwTotalFrames
*
sizeof
(
DWORD
));
if
(
!
infoPtr
->
lpIndex
)
return
FALSE
;
...
...
@@ -640,7 +644,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
infoPtr
->
ash
.
dwSuggestedBufferSize
=
insize
;
}
infoPtr
->
indata
=
Alloc
(
infoPtr
->
ash
.
dwSuggestedBufferSize
);
infoPtr
->
indata
=
heap_alloc_zero
(
infoPtr
->
ash
.
dwSuggestedBufferSize
);
if
(
!
infoPtr
->
indata
)
return
FALSE
;
...
...
@@ -671,7 +675,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
outSize
=
fnIC
.
fnICSendMessage
(
infoPtr
->
hic
,
ICM_DECOMPRESS_GET_FORMAT
,
(
DWORD_PTR
)
infoPtr
->
inbih
,
0L
);
infoPtr
->
outbih
=
Alloc
(
outSize
);
infoPtr
->
outbih
=
heap_alloc_zero
(
outSize
);
if
(
!
infoPtr
->
outbih
)
return
FALSE
;
...
...
@@ -682,7 +686,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
return
FALSE
;
}
infoPtr
->
outdata
=
Alloc
(
infoPtr
->
outbih
->
biSizeImage
);
infoPtr
->
outdata
=
heap_alloc_zero
(
infoPtr
->
outbih
->
biSizeImage
);
if
(
!
infoPtr
->
outdata
)
return
FALSE
;
...
...
@@ -776,12 +780,12 @@ static BOOL ANIMATE_OpenA(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPSTR lpsz
return
ANIMATE_OpenW
(
infoPtr
,
hInstance
,
(
LPWSTR
)
lpszName
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszName
,
-
1
,
NULL
,
0
);
lpwszName
=
A
lloc
(
len
*
sizeof
(
WCHAR
));
lpwszName
=
heap_a
lloc
(
len
*
sizeof
(
WCHAR
));
if
(
!
lpwszName
)
return
FALSE
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszName
,
-
1
,
lpwszName
,
len
);
result
=
ANIMATE_OpenW
(
infoPtr
,
hInstance
,
lpwszName
);
F
ree
(
lpwszName
);
heap_f
ree
(
lpwszName
);
return
result
;
}
...
...
@@ -814,7 +818,7 @@ static BOOL ANIMATE_Create(HWND hWnd, const CREATESTRUCTW *lpcs)
}
/* allocate memory for info structure */
infoPtr
=
Alloc
(
sizeof
(
ANIMATE_INFO
));
infoPtr
=
heap_alloc_zero
(
sizeof
(
*
infoPtr
));
if
(
!
infoPtr
)
return
FALSE
;
/* store crossref hWnd <-> info structure */
...
...
@@ -844,7 +848,7 @@ static LRESULT ANIMATE_Destroy(ANIMATE_INFO *infoPtr)
infoPtr
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
infoPtr
->
cs
);
F
ree
(
infoPtr
);
heap_f
ree
(
infoPtr
);
return
0
;
}
...
...
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