Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
14aab5f3
Commit
14aab5f3
authored
Apr 12, 2006
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 12, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avifil32: Avoid not necessary zeroing out of an allocated memory block.
parent
e0c87731
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
16 deletions
+17
-16
acmstream.c
dlls/avifil32/acmstream.c
+1
-1
api.c
dlls/avifil32/api.c
+8
-7
editstream.c
dlls/avifil32/editstream.c
+2
-2
getframe.c
dlls/avifil32/getframe.c
+2
-2
icmstream.c
dlls/avifil32/icmstream.c
+4
-4
No files found.
dlls/avifil32/acmstream.c
View file @
14aab5f3
...
...
@@ -712,7 +712,7 @@ static HRESULT AVIFILE_OpenCompressor(IAVIStreamImpl *This)
if
(
This
->
lpOutFormat
==
NULL
)
{
/* we must decode to default format */
This
->
cbOutFormat
=
sizeof
(
PCMWAVEFORMAT
);
This
->
lpOutFormat
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
This
->
cbOutFormat
);
This
->
lpOutFormat
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
cbOutFormat
);
if
(
This
->
lpOutFormat
==
NULL
)
return
AVIERR_MEMORY
;
...
...
dlls/avifil32/api.c
View file @
14aab5f3
...
...
@@ -1273,7 +1273,7 @@ static BOOL AVISaveOptionsFmtChoose(HWND hWnd)
sInfo
.
dwStart
,
&
size
);
if
(
size
<
(
LONG
)
sizeof
(
PCMWAVEFORMAT
))
size
=
sizeof
(
PCMWAVEFORMAT
);
afmtc
.
pwfxEnum
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
afmtc
.
pwfxEnum
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
afmtc
.
pwfxEnum
!=
NULL
)
{
AVIStreamReadFormat
(
SaveOpts
.
ppavis
[
SaveOpts
.
nCurrent
],
sInfo
.
dwStart
,
afmtc
.
pwfxEnum
,
&
size
);
...
...
@@ -1318,7 +1318,7 @@ static void AVISaveOptionsUpdate(HWND hWnd)
szFormat
[
0
]
=
0
;
/* read format to build format description string */
lpFormat
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
lpFormat
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
lpFormat
!=
NULL
)
{
if
(
SUCCEEDED
(
AVIStreamReadFormat
(
SaveOpts
.
ppavis
[
SaveOpts
.
nCurrent
],
sInfo
.
dwStart
,
lpFormat
,
&
size
)))
{
if
(
sInfo
.
fccType
==
streamtypeVIDEO
)
{
...
...
@@ -1481,7 +1481,7 @@ BOOL WINAPI AVISaveOptions(HWND hWnd, UINT uFlags, INT nStreams,
/* save options in case the user presses cancel */
if
(
ppOptions
!=
NULL
&&
nStreams
>
1
)
{
pSavedOptions
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
nStreams
*
sizeof
(
AVICOMPRESSOPTIONS
));
pSavedOptions
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nStreams
*
sizeof
(
AVICOMPRESSOPTIONS
));
if
(
pSavedOptions
==
NULL
)
return
FALSE
;
...
...
@@ -1719,7 +1719,8 @@ HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
}
/* allocate buffer for formats, data, etc. of an initial size of 64 kBytes*/
lpBuffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
cbBuffer
=
0x00010000
);
cbBuffer
=
0x00010000
;
lpBuffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cbBuffer
);
if
(
lpBuffer
==
NULL
)
{
hres
=
AVIERR_MEMORY
;
goto
error
;
...
...
@@ -1862,7 +1863,7 @@ HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
lFirstVideo
-
lStart
[
curStream
],
lpBuffer
,
cbBuffer
,
&
lReadBytes
,
&
lReadSamples
);
}
while
((
hres
==
AVIERR_BUFFERTOOSMALL
)
&&
(
lpBuffer
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lpBuffer
,
cbBuffer
*=
2
))
!=
NULL
);
(
lpBuffer
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
lpBuffer
,
cbBuffer
*=
2
))
!=
NULL
);
if
(
lpBuffer
==
NULL
)
hres
=
AVIERR_MEMORY
;
if
(
FAILED
(
hres
))
...
...
@@ -1931,7 +1932,7 @@ HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
hres
=
AVIStreamRead
(
pInStreams
[
curStream
],
sInfo
.
dwStart
,
lSamples
,
lpBuffer
,
cbBuffer
,
&
lReadBytes
,
&
lReadSamples
);
}
while
((
hres
==
AVIERR_BUFFERTOOSMALL
)
&&
(
lpBuffer
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lpBuffer
,
cbBuffer
*=
2
))
!=
NULL
);
(
lpBuffer
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
lpBuffer
,
cbBuffer
*=
2
))
!=
NULL
);
if
(
lpBuffer
==
NULL
)
hres
=
AVIERR_MEMORY
;
if
(
FAILED
(
hres
))
...
...
@@ -1977,7 +1978,7 @@ HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
hres
=
AVIStreamRead
(
pInStreams
[
curStream
],
sInfo
.
dwStart
,
1
,
lpBuffer
,
cbBuffer
,
&
lReadBytes
,
&
lReadSamples
);
}
while
((
hres
==
AVIERR_BUFFERTOOSMALL
)
&&
(
lpBuffer
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lpBuffer
,
cbBuffer
*=
2
))
!=
NULL
);
(
lpBuffer
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
lpBuffer
,
cbBuffer
*=
2
))
!=
NULL
);
if
(
lpBuffer
==
NULL
)
hres
=
AVIERR_MEMORY
;
if
(
FAILED
(
hres
))
...
...
dlls/avifil32/editstream.c
View file @
14aab5f3
...
...
@@ -329,11 +329,11 @@ static BOOL AVIFILE_FormatsEqual(PAVISTREAM avi1, PAVISTREAM avi2)
return
FALSE
;
/* sizes match, now get formats and compare them */
fmt1
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size1
);
fmt1
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size1
);
if
(
fmt1
==
NULL
)
return
FALSE
;
if
(
SUCCEEDED
(
AVIStreamReadFormat
(
avi1
,
start1
,
fmt1
,
&
size1
)))
{
fmt2
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size1
);
fmt2
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size1
);
if
(
fmt2
!=
NULL
)
{
if
(
SUCCEEDED
(
AVIStreamReadFormat
(
avi2
,
start2
,
fmt2
,
&
size1
)))
status
=
(
memcmp
(
fmt1
,
fmt2
,
size1
)
==
0
);
...
...
dlls/avifil32/getframe.c
View file @
14aab5f3
...
...
@@ -366,7 +366,7 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
IAVIStream_ReadFormat
(
This
->
pStream
,
sInfo
.
dwStart
,
NULL
,
&
This
->
cbInFormat
);
This
->
lpInFormat
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
This
->
cbInFormat
+
This
->
cbInBuffer
);
This
->
lpInFormat
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
cbInFormat
+
This
->
cbInBuffer
);
if
(
This
->
lpInFormat
==
NULL
)
{
AVIFILE_CloseCompressor
(
This
);
return
AVIERR_MEMORY
;
...
...
@@ -406,7 +406,7 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
/* need memory for output format? */
if
(
This
->
lpOutFormat
==
NULL
)
{
This
->
lpOutFormat
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
if
(
This
->
lpOutFormat
==
NULL
)
{
AVIFILE_CloseCompressor
(
This
);
return
AVIERR_MEMORY
;
...
...
dlls/avifil32/icmstream.c
View file @
14aab5f3
...
...
@@ -488,7 +488,7 @@ static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos,
size
=
ICCompressGetFormatSize
(
This
->
hic
,
This
->
lpbiInput
);
if
(
size
<
sizeof
(
BITMAPINFOHEADER
))
return
AVIERR_COMPRESSOR
;
This
->
lpbiOutput
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
This
->
lpbiOutput
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
This
->
lpbiOutput
==
NULL
)
return
AVIERR_MEMORY
;
This
->
cbOutput
=
size
;
...
...
@@ -517,7 +517,7 @@ static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos,
if
(
This
->
lKeyFrameEvery
!=
1
&&
(
This
->
dwICMFlags
&
VIDCF_FASTTEMPORALC
)
==
0
)
{
size
=
ICDecompressGetFormatSize
(
This
->
hic
,
This
->
lpbiOutput
);
This
->
lpbiPrev
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
This
->
lpbiPrev
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
This
->
lpbiPrev
==
NULL
)
return
AVIERR_MEMORY
;
if
(
ICDecompressGetFormat
(
This
->
hic
,
This
->
lpbiOutput
,
This
->
lpbiPrev
)
<
S_OK
)
...
...
@@ -913,7 +913,7 @@ static HRESULT AVIFILE_OpenGetFrame(IAVIStreamImpl *This)
size
=
ICCompressGetFormatSize
(
This
->
hic
,
lpbi
);
if
((
LONG
)
size
<
(
LONG
)
sizeof
(
BITMAPINFOHEADER
))
return
AVIERR_COMPRESSOR
;
This
->
lpbiOutput
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
This
->
lpbiOutput
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
This
->
lpbiOutput
==
NULL
)
return
AVIERR_MEMORY
;
This
->
cbOutput
=
size
;
...
...
@@ -945,7 +945,7 @@ static HRESULT AVIFILE_OpenGetFrame(IAVIStreamImpl *This)
if
(
This
->
lKeyFrameEvery
!=
1
&&
(
This
->
dwICMFlags
&
VIDCF_FASTTEMPORALC
)
==
0
)
{
size
=
ICDecompressGetFormatSize
(
This
->
hic
,
This
->
lpbiOutput
);
This
->
lpbiPrev
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
This
->
lpbiPrev
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
This
->
lpbiPrev
==
NULL
)
return
AVIERR_MEMORY
;
if
(
ICDecompressGetFormat
(
This
->
hic
,
This
->
lpbiOutput
,
This
->
lpbiPrev
)
<
S_OK
)
...
...
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