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
610fc08e
Commit
610fc08e
authored
Mar 11, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avifil32: Fix some gcc 4.1 warnings cause by windowsx.h macros.
parent
e1ca8773
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
108 deletions
+92
-108
api.c
dlls/avifil32/api.c
+30
-32
avifile.c
dlls/avifil32/avifile.c
+25
-29
getframe.c
dlls/avifil32/getframe.c
+8
-12
icmstream.c
dlls/avifil32/icmstream.c
+16
-20
wavfile.c
dlls/avifil32/wavfile.c
+13
-15
No files found.
dlls/avifil32/api.c
View file @
610fc08e
This diff is collapsed.
Click to expand it.
dlls/avifil32/avifile.c
View file @
610fc08e
...
...
@@ -316,13 +316,13 @@ static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface)
}
if
(
This
->
idxRecords
!=
NULL
)
{
GlobalFreePtr
(
This
->
idxRecords
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
idxRecords
);
This
->
idxRecords
=
NULL
;
This
->
nIdxRecords
=
0
;
}
if
(
This
->
fileextra
.
lp
!=
NULL
)
{
GlobalFreePtr
(
This
->
fileextra
.
lp
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
fileextra
.
lp
);
This
->
fileextra
.
lp
=
NULL
;
This
->
fileextra
.
cb
=
0
;
}
...
...
@@ -956,7 +956,7 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos,
if
(
This
->
paf
->
dwMoviChunkPos
!=
0
)
return
AVIERR_ERROR
;
/* user has used API in wrong sequnece! */
This
->
lpFormat
=
GlobalAllocPtr
(
GMEM_MOVEABLE
,
formatsize
);
This
->
lpFormat
=
HeapAlloc
(
GetProcessHeap
(),
0
,
formatsize
);
if
(
This
->
lpFormat
==
NULL
)
return
AVIERR_MEMORY
;
This
->
cbFormat
=
formatsize
;
...
...
@@ -1007,7 +1007,7 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos,
/* simply say all colors have changed */
ck
.
ckid
=
MAKEAVICKID
(
cktypePALchange
,
This
->
nStream
);
ck
.
cksize
=
2
*
sizeof
(
WORD
)
+
lpbiOld
->
biClrUsed
*
sizeof
(
PALETTEENTRY
);
lppc
=
(
AVIPALCHANGE
*
)
GlobalAllocPtr
(
GMEM_MOVEABLE
,
ck
.
cksize
);
lppc
=
HeapAlloc
(
GetProcessHeap
(),
0
,
ck
.
cksize
);
if
(
lppc
==
NULL
)
return
AVIERR_MEMORY
;
...
...
@@ -1031,7 +1031,7 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos,
return
AVIERR_FILEWRITE
;
This
->
paf
->
dwNextFramePos
+=
ck
.
cksize
+
2
*
sizeof
(
DWORD
);
GlobalFreePtr
(
lppc
);
HeapFree
(
GetProcessHeap
(),
0
,
lppc
);
return
AVIFILE_AddFrame
(
This
,
cktypePALchange
,
n
,
ck
.
dwDataOffset
,
0
);
}
...
...
@@ -1390,11 +1390,11 @@ static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DW
This
->
nIdxFmtChanges
+=
16
;
if
(
This
->
idxFmtChanges
==
NULL
)
This
->
idxFmtChanges
=
GlobalAllocPtr
(
GHND
,
This
->
nIdxFmtChanges
*
sizeof
(
AVIINDEXENTRY
));
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
nIdxFmtChanges
*
sizeof
(
AVIINDEXENTRY
));
else
This
->
idxFmtChanges
=
GlobalReAllocPtr
(
This
->
idxFmtChanges
,
This
->
nIdxFmtChanges
*
sizeof
(
AVIINDEXENTRY
)
,
GHND
);
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
idxFmtChanges
,
This
->
nIdxFmtChanges
*
sizeof
(
AVIINDEXENTRY
));
if
(
This
->
idxFmtChanges
==
NULL
)
return
AVIERR_MEMORY
;
...
...
@@ -1426,12 +1426,10 @@ static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DW
if
(
This
->
idxFrames
==
NULL
||
This
->
lLastFrame
+
1
>=
This
->
nIdxFrames
)
{
This
->
nIdxFrames
+=
512
;
if
(
This
->
idxFrames
==
NULL
)
This
->
idxFrames
=
GlobalAllocPtr
(
GHND
,
This
->
nIdxFrames
*
sizeof
(
AVIINDEXENTRY
));
This
->
idxFrames
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
nIdxFrames
*
sizeof
(
AVIINDEXENTRY
));
else
This
->
idxFrames
=
GlobalReAllocPtr
(
This
->
idxFrames
,
This
->
nIdxFrames
*
sizeof
(
AVIINDEXENTRY
),
GHND
);
This
->
idxFrames
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
idxFrames
,
This
->
nIdxFrames
*
sizeof
(
AVIINDEXENTRY
));
if
(
This
->
idxFrames
==
NULL
)
return
AVIERR_MEMORY
;
}
...
...
@@ -1456,7 +1454,7 @@ static HRESULT AVIFILE_AddRecord(IAVIFileImpl *This)
if
(
This
->
idxRecords
==
NULL
||
This
->
cbIdxRecords
==
0
)
{
This
->
cbIdxRecords
+=
1024
*
sizeof
(
AVIINDEXENTRY
);
This
->
idxRecords
=
GlobalAllocPtr
(
GHND
,
This
->
cbIdxRecords
);
This
->
idxRecords
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
cbIdxRecords
);
if
(
This
->
idxRecords
==
NULL
)
return
AVIERR_MEMORY
;
}
...
...
@@ -1531,14 +1529,14 @@ static void AVIFILE_ConstructAVIStream(IAVIFileImpl *paf, DWORD nr, LPAVISTRE
if
(
asi
->
dwLength
>
0
)
{
/* pre-allocate mem for frame-index structure */
pstream
->
idxFrames
=
(
AVIINDEXENTRY
*
)
GlobalAllocPtr
(
GHND
,
asi
->
dwLength
*
sizeof
(
AVIINDEXENTRY
));
HeapAlloc
(
GetProcessHeap
(),
0
,
asi
->
dwLength
*
sizeof
(
AVIINDEXENTRY
));
if
(
pstream
->
idxFrames
!=
NULL
)
pstream
->
nIdxFrames
=
asi
->
dwLength
;
}
if
(
asi
->
dwFormatChangeCount
>
0
)
{
/* pre-allocate mem for formatchange-index structure */
pstream
->
idxFmtChanges
=
(
AVIINDEXENTRY
*
)
GlobalAllocPtr
(
GHND
,
asi
->
dwFormatChangeCount
*
sizeof
(
AVIINDEXENTRY
));
HeapAlloc
(
GetProcessHeap
(),
0
,
asi
->
dwFormatChangeCount
*
sizeof
(
AVIINDEXENTRY
));
if
(
pstream
->
idxFmtChanges
!=
NULL
)
pstream
->
nIdxFmtChanges
=
asi
->
dwFormatChangeCount
;
}
...
...
@@ -1564,16 +1562,16 @@ static void AVIFILE_DestructAVIStream(IAVIStreamImpl *This)
This
->
lLastFrame
=
-
1
;
This
->
paf
=
NULL
;
if
(
This
->
idxFrames
!=
NULL
)
{
GlobalFreePtr
(
This
->
idxFrames
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
idxFrames
);
This
->
idxFrames
=
NULL
;
This
->
nIdxFrames
=
0
;
}
if
(
This
->
idxFmtChanges
!=
NULL
)
{
GlobalFreePtr
(
This
->
idxFmtChanges
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
idxFmtChanges
);
This
->
idxFmtChanges
=
NULL
;
}
if
(
This
->
lpBuffer
!=
NULL
)
{
GlobalFreePtr
(
This
->
lpBuffer
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
lpBuffer
);
This
->
lpBuffer
=
NULL
;
This
->
cbBuffer
=
0
;
}
...
...
@@ -1583,12 +1581,12 @@ static void AVIFILE_DestructAVIStream(IAVIStreamImpl *This)
This
->
cbHandlerData
=
0
;
}
if
(
This
->
extra
.
lp
!=
NULL
)
{
GlobalFreePtr
(
This
->
extra
.
lp
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
extra
.
lp
);
This
->
extra
.
lp
=
NULL
;
This
->
extra
.
cb
=
0
;
}
if
(
This
->
lpFormat
!=
NULL
)
{
GlobalFreePtr
(
This
->
lpFormat
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
lpFormat
);
This
->
lpFormat
=
NULL
;
This
->
cbFormat
=
0
;
}
...
...
@@ -1918,8 +1916,7 @@ static HRESULT AVIFILE_LoadIndex(IAVIFileImpl *This, DWORD size, DWORD offset)
HRESULT
hr
=
AVIERR_OK
;
BOOL
bAbsolute
=
TRUE
;
lp
=
(
AVIINDEXENTRY
*
)
GlobalAllocPtr
(
GMEM_MOVEABLE
,
IDX_PER_BLOCK
*
sizeof
(
AVIINDEXENTRY
));
lp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
IDX_PER_BLOCK
*
sizeof
(
AVIINDEXENTRY
));
if
(
lp
==
NULL
)
return
AVIERR_MEMORY
;
...
...
@@ -1930,7 +1927,7 @@ static HRESULT AVIFILE_LoadIndex(IAVIFileImpl *This, DWORD size, DWORD offset)
pStream
->
lLastFrame
=
-
1
;
if
(
pStream
->
idxFrames
!=
NULL
)
{
GlobalFreePtr
(
pStream
->
idxFrames
);
HeapFree
(
GetProcessHeap
(),
0
,
pStream
->
idxFrames
);
pStream
->
idxFrames
=
NULL
;
pStream
->
nIdxFrames
=
0
;
}
...
...
@@ -1946,7 +1943,7 @@ static HRESULT AVIFILE_LoadIndex(IAVIFileImpl *This, DWORD size, DWORD offset)
pStream
->
nIdxFrames
=
pStream
->
sInfo
.
dwLength
;
pStream
->
idxFrames
=
(
AVIINDEXENTRY
*
)
GlobalAllocPtr
(
GHND
,
pStream
->
nIdxFrames
*
sizeof
(
AVIINDEXENTRY
));
HeapAlloc
(
GetProcessHeap
(),
0
,
pStream
->
nIdxFrames
*
sizeof
(
AVIINDEXENTRY
));
if
(
pStream
->
idxFrames
==
NULL
&&
pStream
->
nIdxFrames
>
0
)
{
pStream
->
nIdxFrames
=
0
;
return
AVIERR_MEMORY
;
...
...
@@ -1971,7 +1968,7 @@ static HRESULT AVIFILE_LoadIndex(IAVIFileImpl *This, DWORD size, DWORD offset)
}
if
(
lp
!=
NULL
)
GlobalFreePtr
(
lp
);
HeapFree
(
GetProcessHeap
(),
0
,
lp
);
/* checking ... */
for
(
n
=
0
;
n
<
This
->
fInfo
.
dwStreams
;
n
++
)
{
...
...
@@ -2040,10 +2037,9 @@ static HRESULT AVIFILE_ReadBlock(IAVIStreamImpl *This, DWORD pos,
DWORD
maxSize
=
max
(
size
,
This
->
sInfo
.
dwSuggestedBufferSize
);
if
(
This
->
lpBuffer
==
NULL
)
This
->
lpBuffer
=
(
LPDWORD
)
GlobalAllocPtr
(
GMEM_MOVEABLE
,
maxSize
);
This
->
lpBuffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
maxSize
);
else
This
->
lpBuffer
=
(
LPDWORD
)
GlobalReAllocPtr
(
This
->
lpBuffer
,
maxSize
,
GMEM_MOVEABLE
);
This
->
lpBuffer
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
lpBuffer
,
maxSize
);
if
(
This
->
lpBuffer
==
NULL
)
return
AVIERR_MEMORY
;
This
->
cbBuffer
=
max
(
size
,
This
->
sInfo
.
dwSuggestedBufferSize
);
...
...
dlls/avifil32/getframe.c
View file @
610fc08e
...
...
@@ -23,7 +23,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "windowsx.h"
#include "wingdi.h"
#include "winuser.h"
#include "vfw.h"
...
...
@@ -99,11 +98,11 @@ typedef struct _IGetFrameImpl {
static
void
AVIFILE_CloseCompressor
(
IGetFrameImpl
*
This
)
{
if
(
This
->
lpOutFormat
!=
NULL
&&
This
->
lpInFormat
!=
This
->
lpOutFormat
)
{
GlobalFreePtr
(
This
->
lpOutFormat
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
lpOutFormat
);
This
->
lpOutFormat
=
NULL
;
}
if
(
This
->
lpInFormat
!=
NULL
)
{
GlobalFreePtr
(
This
->
lpInFormat
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
lpInFormat
);
This
->
lpInFormat
=
NULL
;
}
if
(
This
->
hic
!=
NULL
)
{
...
...
@@ -124,7 +123,7 @@ PGETFRAME AVIFILE_CreateGetFrame(PAVISTREAM pStream)
if
(
pStream
==
NULL
)
return
NULL
;
pg
=
(
IGetFrameImpl
*
)
LocalAlloc
(
LPTR
,
sizeof
(
IGetFrameImpl
));
pg
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IGetFrameImpl
));
if
(
pg
!=
NULL
)
{
pg
->
lpVtbl
=
&
igetframeVtbl
;
pg
->
ref
=
1
;
...
...
@@ -176,7 +175,7 @@ static ULONG WINAPI IGetFrame_fnRelease(IGetFrame *iface)
This
->
pStream
=
NULL
;
}
LocalFree
((
HLOCAL
)
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
iface
);
return
0
;
}
...
...
@@ -266,7 +265,7 @@ static LPVOID WINAPI IGetFrame_fnGetFrame(IGetFrame *iface, LONG lPos)
if
(
This
->
cbInBuffer
>=
readBytes
)
break
;
This
->
cbInBuffer
=
This
->
cbInFormat
+
readBytes
;
This
->
lpInFormat
=
GlobalReAllocPtr
(
This
->
lpInFormat
,
This
->
cbInBuffer
,
0
);
This
->
lpInFormat
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
lpInFormat
,
This
->
cbInBuffer
);
if
(
This
->
lpInFormat
==
NULL
)
return
NULL
;
/* out of memory */
This
->
lpInBuffer
=
(
BYTE
*
)
This
->
lpInFormat
+
This
->
cbInFormat
;
...
...
@@ -367,8 +366,7 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
IAVIStream_ReadFormat
(
This
->
pStream
,
sInfo
.
dwStart
,
NULL
,
&
This
->
cbInFormat
);
This
->
lpInFormat
=
(
LPBITMAPINFOHEADER
)
GlobalAllocPtr
(
GHND
,
This
->
cbInFormat
+
This
->
cbInBuffer
);
This
->
lpInFormat
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
cbInFormat
+
This
->
cbInBuffer
);
if
(
This
->
lpInFormat
==
NULL
)
{
AVIFILE_CloseCompressor
(
This
);
return
AVIERR_MEMORY
;
...
...
@@ -408,8 +406,7 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
/* need memory for output format? */
if
(
This
->
lpOutFormat
==
NULL
)
{
This
->
lpOutFormat
=
(
LPBITMAPINFOHEADER
)
GlobalAllocPtr
(
GHND
,
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
if
(
This
->
lpOutFormat
==
NULL
)
{
AVIFILE_CloseCompressor
(
This
);
return
AVIERR_MEMORY
;
...
...
@@ -478,8 +475,7 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
register
DWORD
size
=
This
->
lpOutFormat
->
biClrUsed
*
sizeof
(
RGBQUAD
);
size
+=
This
->
lpOutFormat
->
biSize
+
This
->
lpOutFormat
->
biSizeImage
;
This
->
lpOutFormat
=
(
LPBITMAPINFOHEADER
)
GlobalReAllocPtr
(
This
->
lpOutFormat
,
size
,
GMEM_MOVEABLE
);
This
->
lpOutFormat
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
lpOutFormat
,
size
);
if
(
This
->
lpOutFormat
==
NULL
)
{
AVIFILE_CloseCompressor
(
This
);
return
AVIERR_MEMORY
;
...
...
dlls/avifil32/icmstream.c
View file @
610fc08e
...
...
@@ -26,7 +26,6 @@
#include "winuser.h"
#include "winnls.h"
#include "winerror.h"
#include "windowsx.h"
#include "mmsystem.h"
#include "vfw.h"
#include "msacm.h"
...
...
@@ -128,7 +127,7 @@ HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppv)
*
ppv
=
NULL
;
pstream
=
(
IAVIStreamImpl
*
)
LocalAlloc
(
LPTR
,
sizeof
(
IAVIStreamImpl
));
pstream
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IAVIStreamImpl
));
if
(
pstream
==
NULL
)
return
AVIERR_MEMORY
;
...
...
@@ -137,7 +136,7 @@ HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppv)
hr
=
IAVIStream_QueryInterface
((
IAVIStream
*
)
pstream
,
riid
,
ppv
);
if
(
FAILED
(
hr
))
LocalFree
((
HLOCAL
)
pstream
);
HeapFree
(
GetProcessHeap
(),
0
,
pstream
);
return
hr
;
}
...
...
@@ -194,7 +193,7 @@ static ULONG WINAPI ICMStream_fnRelease(IAVIStream* iface)
if
(
This
->
hic
!=
NULL
)
{
if
(
This
->
lpbiPrev
!=
NULL
)
{
ICDecompressEnd
(
This
->
hic
);
GlobalFreePtr
(
This
->
lpbiPrev
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
lpbiPrev
);
This
->
lpbiPrev
=
NULL
;
This
->
lpPrev
=
NULL
;
}
...
...
@@ -202,22 +201,22 @@ static ULONG WINAPI ICMStream_fnRelease(IAVIStream* iface)
This
->
hic
=
NULL
;
}
if
(
This
->
lpbiCur
!=
NULL
)
{
GlobalFreePtr
(
This
->
lpbiCur
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
lpbiCur
);
This
->
lpbiCur
=
NULL
;
This
->
lpCur
=
NULL
;
}
if
(
This
->
lpbiOutput
!=
NULL
)
{
GlobalFreePtr
(
This
->
lpbiOutput
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
lpbiOutput
);
This
->
lpbiOutput
=
NULL
;
This
->
cbOutput
=
0
;
}
if
(
This
->
lpbiInput
!=
NULL
)
{
GlobalFreePtr
(
This
->
lpbiInput
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
lpbiInput
);
This
->
lpbiInput
=
NULL
;
This
->
cbInput
=
0
;
}
LocalFree
((
HLOCAL
)
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
...
...
@@ -479,7 +478,7 @@ static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos,
assert
(
This
->
hic
!=
NULL
);
/* get memory for input format */
This
->
lpbiInput
=
(
LPBITMAPINFOHEADER
)
GlobalAllocPtr
(
GHND
,
formatsize
);
This
->
lpbiInput
=
HeapAlloc
(
GetProcessHeap
(),
0
,
formatsize
);
if
(
This
->
lpbiInput
==
NULL
)
return
AVIERR_MEMORY
;
This
->
cbInput
=
formatsize
;
...
...
@@ -489,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
=
(
LPBITMAPINFOHEADER
)
GlobalAllocPtr
(
GHND
,
size
);
This
->
lpbiOutput
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
This
->
lpbiOutput
==
NULL
)
return
AVIERR_MEMORY
;
This
->
cbOutput
=
size
;
...
...
@@ -508,8 +507,7 @@ static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos,
/* allocate memory for compressed frame */
size
=
ICCompressGetSize
(
This
->
hic
,
This
->
lpbiInput
,
This
->
lpbiOutput
);
This
->
lpbiCur
=
(
LPBITMAPINFOHEADER
)
GlobalAllocPtr
(
GMEM_MOVEABLE
,
This
->
cbOutput
+
size
);
This
->
lpbiCur
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
cbOutput
+
size
);
if
(
This
->
lpbiCur
==
NULL
)
return
AVIERR_MEMORY
;
memcpy
(
This
->
lpbiCur
,
This
->
lpbiOutput
,
This
->
cbOutput
);
...
...
@@ -519,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
=
(
LPBITMAPINFOHEADER
)
GlobalAllocPtr
(
GHND
,
size
);
This
->
lpbiPrev
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
This
->
lpbiPrev
==
NULL
)
return
AVIERR_MEMORY
;
if
(
ICDecompressGetFormat
(
This
->
hic
,
This
->
lpbiOutput
,
This
->
lpbiPrev
)
<
S_OK
)
...
...
@@ -532,8 +530,7 @@ static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos,
/* get memory for format and picture */
size
+=
This
->
lpbiPrev
->
biSizeImage
;
This
->
lpbiPrev
=
(
LPBITMAPINFOHEADER
)
GlobalReAllocPtr
(
This
->
lpbiPrev
,
size
,
GMEM_MOVEABLE
);
This
->
lpbiPrev
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
lpbiPrev
,
size
);
if
(
This
->
lpbiPrev
==
NULL
)
return
AVIERR_MEMORY
;
This
->
lpPrev
=
DIBPTR
(
This
->
lpbiPrev
);
...
...
@@ -916,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
=
(
LPBITMAPINFOHEADER
)
GlobalAllocPtr
(
GHND
,
size
);
This
->
lpbiOutput
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
This
->
lpbiOutput
==
NULL
)
return
AVIERR_MEMORY
;
This
->
cbOutput
=
size
;
...
...
@@ -938,7 +935,7 @@ static HRESULT AVIFILE_OpenGetFrame(IAVIStreamImpl *This)
/* allocate memory for current frame */
size
+=
This
->
sInfo
.
dwSuggestedBufferSize
;
This
->
lpbiCur
=
(
LPBITMAPINFOHEADER
)
GlobalAllocPtr
(
GMEM_MOVEABLE
,
size
);
This
->
lpbiCur
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
This
->
lpbiCur
==
NULL
)
return
AVIERR_MEMORY
;
memcpy
(
This
->
lpbiCur
,
This
->
lpbiOutput
,
This
->
cbOutput
);
...
...
@@ -948,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
=
(
LPBITMAPINFOHEADER
)
GlobalAllocPtr
(
GHND
,
size
);
This
->
lpbiPrev
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
This
->
lpbiPrev
==
NULL
)
return
AVIERR_MEMORY
;
if
(
ICDecompressGetFormat
(
This
->
hic
,
This
->
lpbiOutput
,
This
->
lpbiPrev
)
<
S_OK
)
...
...
@@ -961,8 +958,7 @@ static HRESULT AVIFILE_OpenGetFrame(IAVIStreamImpl *This)
/* get memory for format and picture */
size
+=
This
->
lpbiPrev
->
biSizeImage
;
This
->
lpbiPrev
=
(
LPBITMAPINFOHEADER
)
GlobalReAllocPtr
(
This
->
lpbiPrev
,
size
,
GMEM_MOVEABLE
);
This
->
lpbiPrev
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
lpbiPrev
,
size
);
if
(
This
->
lpbiPrev
==
NULL
)
return
AVIERR_MEMORY
;
This
->
lpPrev
=
DIBPTR
(
This
->
lpbiPrev
);
...
...
dlls/avifil32/wavfile.c
View file @
610fc08e
...
...
@@ -26,7 +26,6 @@
#include "winuser.h"
#include "winnls.h"
#include "winerror.h"
#include "windowsx.h"
#include "mmsystem.h"
#include "vfw.h"
#include "msacm.h"
...
...
@@ -225,7 +224,7 @@ HRESULT AVIFILE_CreateWAVFile(REFIID riid, LPVOID *ppv)
*
ppv
=
NULL
;
pfile
=
(
IAVIFileImpl
*
)
LocalAlloc
(
LPTR
,
sizeof
(
IAVIFileImpl
));
pfile
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IAVIFileImpl
));
if
(
pfile
==
NULL
)
return
AVIERR_MEMORY
;
...
...
@@ -238,7 +237,7 @@ HRESULT AVIFILE_CreateWAVFile(REFIID riid, LPVOID *ppv)
hr
=
IAVIFile_QueryInterface
((
IAVIFile
*
)
pfile
,
riid
,
ppv
);
if
(
FAILED
(
hr
))
LocalFree
((
HLOCAL
)
pfile
);
HeapFree
(
GetProcessHeap
(),
0
,
pfile
);
return
hr
;
}
...
...
@@ -289,17 +288,17 @@ static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface)
}
if
(
This
->
lpFormat
!=
NULL
)
{
GlobalFreePtr
(
This
->
lpFormat
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
lpFormat
);
This
->
lpFormat
=
NULL
;
This
->
cbFormat
=
0
;
}
if
(
This
->
extra
.
lp
!=
NULL
)
{
GlobalFreePtr
(
This
->
extra
.
lp
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
extra
.
lp
);
This
->
extra
.
lp
=
NULL
;
This
->
extra
.
cb
=
0
;
}
if
(
This
->
szFileName
!=
NULL
)
{
LocalFree
((
HLOCAL
)
This
->
szFileName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
szFileName
);
This
->
szFileName
=
NULL
;
}
if
(
This
->
hmmio
!=
NULL
)
{
...
...
@@ -307,7 +306,7 @@ static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface)
This
->
hmmio
=
NULL
;
}
LocalFree
((
HLOCAL
)
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
ref
;
...
...
@@ -485,7 +484,7 @@ static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile *iface, DWORD fccType,
if
((
This
->
uMode
&
MMIO_RWMODE
)
==
0
)
return
AVIERR_READONLY
;
GlobalFreePtr
(
This
->
lpFormat
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
lpFormat
);
This
->
lpFormat
=
NULL
;
This
->
cbFormat
=
0
;
...
...
@@ -582,7 +581,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
This
->
uMode
=
dwMode
;
len
=
lstrlenW
(
pszFileName
)
+
1
;
This
->
szFileName
=
LocalAlloc
(
LPTR
,
len
*
sizeof
(
WCHAR
));
This
->
szFileName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
This
->
szFileName
==
NULL
)
return
AVIERR_MEMORY
;
lstrcpyW
(
This
->
szFileName
,
pszFileName
);
...
...
@@ -594,7 +593,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
LPSTR
szFileName
;
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
This
->
szFileName
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
szFileName
=
LocalAlloc
(
LPTR
,
len
*
sizeof
(
CHAR
));
szFileName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
CHAR
));
if
(
szFileName
==
NULL
)
return
AVIERR_MEMORY
;
...
...
@@ -602,7 +601,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
len
,
NULL
,
NULL
);
This
->
hmmio
=
mmioOpenA
(
szFileName
,
NULL
,
MMIO_ALLOCBUF
|
dwMode
);
LocalFree
((
HLOCAL
)
szFileName
);
HeapFree
(
GetProcessHeap
(),
0
,
szFileName
);
if
(
This
->
hmmio
==
NULL
)
return
AVIERR_FILEOPEN
;
}
...
...
@@ -826,7 +825,7 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos,
return
AVIERR_READONLY
;
/* get memory for format and copy it */
This
->
lpFormat
=
(
LPWAVEFORMATEX
)
GlobalAllocPtr
(
GMEM_MOVEABLE
,
formatsize
);
This
->
lpFormat
=
HeapAlloc
(
GetProcessHeap
(),
0
,
formatsize
);
if
(
This
->
lpFormat
==
NULL
)
return
AVIERR_MEMORY
;
...
...
@@ -1079,7 +1078,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
return
AVIERR_FILEREAD
;
/* get memory for format and read it */
This
->
lpFormat
=
(
LPWAVEFORMATEX
)
GlobalAllocPtr
(
GMEM_MOVEABLE
,
ck
.
cksize
);
This
->
lpFormat
=
HeapAlloc
(
GetProcessHeap
(),
0
,
ck
.
cksize
);
if
(
This
->
lpFormat
==
NULL
)
return
AVIERR_FILEREAD
;
This
->
cbFormat
=
ck
.
cksize
;
...
...
@@ -1168,8 +1167,7 @@ static HRESULT AVIFILE_LoadSunFile(IAVIFileImpl *This)
This
->
cbFormat
=
sizeof
(
WAVEFORMATEX
);
break
;
};
This
->
lpFormat
=
(
LPWAVEFORMATEX
)
GlobalAllocPtr
(
GMEM_MOVEABLE
,
This
->
cbFormat
);
This
->
lpFormat
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
cbFormat
);
if
(
This
->
lpFormat
==
NULL
)
return
AVIERR_MEMORY
;
...
...
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