Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
dfb5aaf3
Commit
dfb5aaf3
authored
19 years ago
by
Michael McCormack
Committed by
Alexandre Julliard
19 years ago
Browse files
Options
Downloads
Patches
Plain Diff
avifil32: Use HeapAlloc instead of Global/LocalAlloc.
parent
15c5dc12
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/avifil32/editstream.c
+13
-20
13 additions, 20 deletions
dlls/avifil32/editstream.c
with
13 additions
and
20 deletions
dlls/avifil32/editstream.c
+
13
−
20
View file @
dfb5aaf3
...
...
@@ -187,7 +187,7 @@ PAVIEDITSTREAM AVIFILE_CreateEditStream(PAVISTREAM pstream)
{
IAVIEditStreamImpl
*
pedit
=
NULL
;
pedit
=
(
IAVIEditStreamImpl
*
)
LocalAlloc
(
LPTR
,
sizeof
(
IAVIEditStreamImpl
));
pedit
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IAVIEditStreamImpl
));
if
(
pedit
==
NULL
)
return
NULL
;
...
...
@@ -329,11 +329,11 @@ static BOOL AVIFILE_FormatsEqual(PAVISTREAM avi1, PAVISTREAM avi2)
return
FALSE
;
/* sizes match, now get formats and compare them */
fmt1
=
GlobalL
oc
k
(
G
lobalAlloc
(
GHND
,
size1
)
)
;
fmt1
=
HeapAll
oc
(
G
etProcessHeap
(),
0
,
size1
);
if
(
fmt1
==
NULL
)
return
FALSE
;
if
(
SUCCEEDED
(
AVIStreamReadFormat
(
avi1
,
start1
,
fmt1
,
&
size1
)))
{
fmt2
=
GlobalL
oc
k
(
G
lobalAlloc
(
GHND
,
size1
)
)
;
fmt2
=
HeapAll
oc
(
G
etProcessHeap
(),
0
,
size1
);
if
(
fmt2
!=
NULL
)
{
if
(
SUCCEEDED
(
AVIStreamReadFormat
(
avi2
,
start2
,
fmt2
,
&
size1
)))
status
=
(
memcmp
(
fmt1
,
fmt2
,
size1
)
==
0
);
...
...
@@ -341,12 +341,8 @@ static BOOL AVIFILE_FormatsEqual(PAVISTREAM avi1, PAVISTREAM avi2)
}
if
(
fmt2
!=
NULL
)
{
GlobalUnlock
(
GlobalHandle
(
fmt2
));
GlobalFree
(
GlobalHandle
(
fmt2
));
}
GlobalUnlock
(
GlobalHandle
(
fmt1
));
GlobalFree
(
GlobalHandle
(
fmt1
));
HeapFree
(
GetProcessHeap
(),
0
,
fmt2
);
HeapFree
(
GetProcessHeap
(),
0
,
fmt1
);
return
status
;
}
...
...
@@ -407,11 +403,10 @@ static ULONG WINAPI IAVIEditStream_fnRelease(IAVIEditStream*iface)
if
(
This
->
pStreams
[
i
].
pStream
!=
NULL
)
IAVIStream_Release
(
This
->
pStreams
[
i
].
pStream
);
}
GlobalUnlock
(
GlobalHandle
(
This
->
pStreams
));
GlobalFree
(
GlobalHandle
(
This
->
pStreams
));
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pStreams
);
}
LocalFree
((
HLOCAL
)
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
ref
;
...
...
@@ -474,8 +469,8 @@ static HRESULT WINAPI IAVIEditStream_fnCut(IAVIEditStream*iface,LONG*plStart,
}
else
{
/* splitting */
if
(
This
->
nStreams
+
1
>=
This
->
nTableSize
)
{
GlobalUn
loc
k
(
G
lobalHandle
(
This
->
pStreams
));
This
->
pStreams
=
GlobalLock
(
GlobalReAlloc
(
GlobalHandle
(
This
->
pStreams
),
(
This
->
nTableSize
+
32
)
*
sizeof
(
EditStreamTable
)
,
GMEM_SHARE
|
GHND
)
);
This
->
pStreams
=
HeapReAl
loc
(
G
etProcessHeap
(),
0
,
This
->
pStreams
,
(
This
->
nTableSize
+
32
)
*
sizeof
(
EditStreamTable
));
if
(
This
->
pStreams
==
NULL
)
return
AVIERR_MEMORY
;
This
->
nTableSize
+=
32
;
...
...
@@ -666,8 +661,7 @@ static HRESULT WINAPI IAVIEditStream_fnPaste(IAVIEditStream*iface,LONG*plStart,
if
(
This
->
nStreams
+
nStreams
+
1
>
This
->
nTableSize
)
{
n
=
This
->
nStreams
+
nStreams
+
33
;
GlobalUnlock
(
GlobalHandle
(
This
->
pStreams
));
This
->
pStreams
=
GlobalLock
(
GlobalReAlloc
(
GlobalHandle
(
This
->
pStreams
),
n
*
sizeof
(
EditStreamTable
),
GMEM_SHARE
|
GHND
));
This
->
pStreams
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
pStreams
,
n
*
sizeof
(
EditStreamTable
));
if
(
This
->
pStreams
==
NULL
)
return
AVIERR_MEMORY
;
This
->
nTableSize
=
n
;
...
...
@@ -756,8 +750,8 @@ static HRESULT WINAPI IAVIEditStream_fnClone(IAVIEditStream*iface,
if
(
pEdit
==
NULL
)
return
AVIERR_MEMORY
;
if
(
This
->
nStreams
>
pEdit
->
nTableSize
)
{
GlobalUn
loc
k
(
G
lobalHandle
(
pEdit
->
pStreams
));
pEdit
->
pStreams
=
GlobalLock
(
GlobalReAlloc
(
GlobalHandle
(
pEdit
->
pStreams
),
This
->
nStreams
*
sizeof
(
EditStreamTable
)
,
GMEM_SHARE
|
GHND
)
);
pEdit
->
pStreams
=
HeapReAl
loc
(
G
etProcessHeap
(),
0
,
pEdit
->
pStreams
,
This
->
nStreams
*
sizeof
(
EditStreamTable
));
if
(
pEdit
->
pStreams
==
NULL
)
return
AVIERR_MEMORY
;
pEdit
->
nTableSize
=
This
->
nStreams
;
...
...
@@ -845,8 +839,7 @@ static HRESULT WINAPI IEditAVIStream_fnCreate(IAVIStream*iface,
return
AVIERR_ERROR
;
if
(
This
->
pStreams
==
NULL
)
{
This
->
pStreams
=
GlobalLock
(
GlobalAlloc
(
GMEM_SHARE
|
GHND
,
256
*
sizeof
(
EditStreamTable
)));
This
->
pStreams
=
HeapAlloc
(
GetProcessHeap
(),
0
,
256
*
sizeof
(
EditStreamTable
));
if
(
This
->
pStreams
==
NULL
)
return
AVIERR_MEMORY
;
This
->
nTableSize
=
256
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment