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
b0b63aec
Commit
b0b63aec
authored
Nov 26, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap: Use malloc() instead of HeapAlloc() or CoTaskMemAlloc().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8f8cdc7a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
40 deletions
+31
-40
audiorecord.c
dlls/qcap/audiorecord.c
+2
-3
avico.c
dlls/qcap/avico.c
+5
-7
avimux.c
dlls/qcap/avimux.c
+12
-14
capturegraph.c
dlls/qcap/capturegraph.c
+2
-2
filewriter.c
dlls/qcap/filewriter.c
+5
-6
qcap_private.h
dlls/qcap/qcap_private.h
+0
-1
smartteefilter.c
dlls/qcap/smartteefilter.c
+3
-4
vfwcapture.c
dlls/qcap/vfwcapture.c
+2
-3
No files found.
dlls/qcap/audiorecord.c
View file @
b0b63aec
...
...
@@ -47,7 +47,7 @@ static void audio_record_destroy(struct strmbase_filter *iface)
AudioRecord
*
filter
=
impl_from_strmbase_filter
(
iface
);
strmbase_filter_cleanup
(
&
filter
->
filter
);
CoTaskMemF
ree
(
filter
);
f
ree
(
filter
);
}
static
HRESULT
audio_record_query_interface
(
struct
strmbase_filter
*
iface
,
REFIID
iid
,
void
**
out
)
...
...
@@ -144,9 +144,8 @@ HRESULT audio_record_create(IUnknown *outer, IUnknown **out)
{
AudioRecord
*
object
;
if
(
!
(
object
=
CoTaskMemAlloc
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
memset
(
object
,
0
,
sizeof
(
*
object
));
object
->
IPersistPropertyBag_iface
.
lpVtbl
=
&
PersistPropertyBagVtbl
;
strmbase_filter_init
(
&
object
->
filter
,
outer
,
&
CLSID_AudioRecord
,
&
filter_ops
);
...
...
dlls/qcap/avico.c
View file @
b0b63aec
...
...
@@ -85,13 +85,11 @@ static HRESULT fill_format_info(AVICompressor *This, VIDEOINFOHEADER *src_videoi
}
size
+=
FIELD_OFFSET
(
VIDEOINFOHEADER
,
bmiHeader
);
This
->
videoinfo
=
heap_alloc
(
size
);
if
(
!
This
->
videoinfo
)
if
(
!
(
This
->
videoinfo
=
calloc
(
1
,
size
)))
return
E_OUTOFMEMORY
;
This
->
videoinfo_size
=
size
;
This
->
driver_flags
=
icinfo
.
dwFlags
;
memset
(
This
->
videoinfo
,
0
,
sizeof
(
*
This
->
videoinfo
));
ICCompressGetFormat
(
This
->
hic
,
&
src_videoinfo
->
bmiHeader
,
&
This
->
videoinfo
->
bmiHeader
);
This
->
videoinfo
->
dwBitRate
=
10000000
/
src_videoinfo
->
AvgTimePerFrame
*
This
->
videoinfo
->
bmiHeader
.
biSizeImage
*
8
;
...
...
@@ -117,11 +115,11 @@ static void avi_compressor_destroy(struct strmbase_filter *iface)
if
(
filter
->
hic
)
ICClose
(
filter
->
hic
);
heap_
free
(
filter
->
videoinfo
);
free
(
filter
->
videoinfo
);
strmbase_sink_cleanup
(
&
filter
->
sink
);
strmbase_source_cleanup
(
&
filter
->
source
);
strmbase_filter_cleanup
(
&
filter
->
filter
);
heap_
free
(
filter
);
free
(
filter
);
}
static
HRESULT
avi_compressor_query_interface
(
struct
strmbase_filter
*
iface
,
REFIID
iid
,
void
**
out
)
...
...
@@ -401,7 +399,7 @@ static HRESULT sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_ME
static
void
sink_disconnect
(
struct
strmbase_sink
*
iface
)
{
AVICompressor
*
filter
=
impl_from_strmbase_pin
(
&
iface
->
pin
);
heap_
free
(
filter
->
videoinfo
);
free
(
filter
->
videoinfo
);
filter
->
videoinfo
=
NULL
;
}
...
...
@@ -470,7 +468,7 @@ HRESULT avi_compressor_create(IUnknown *outer, IUnknown **out)
{
AVICompressor
*
object
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
strmbase_filter_init
(
&
object
->
filter
,
outer
,
&
CLSID_AVICo
,
&
filter_ops
);
...
...
dlls/qcap/avimux.c
View file @
b0b63aec
...
...
@@ -125,12 +125,12 @@ static void avi_mux_destroy(struct strmbase_filter *iface)
IMemAllocator_Release
(
filter
->
in
[
i
]
->
samples_allocator
);
filter
->
in
[
i
]
->
samples_allocator
=
NULL
;
strmbase_sink_cleanup
(
&
filter
->
in
[
i
]
->
pin
);
heap_
free
(
filter
->
in
[
i
]);
free
(
filter
->
in
[
i
]);
}
heap_
free
(
filter
->
idx1
);
free
(
filter
->
idx1
);
strmbase_filter_cleanup
(
&
filter
->
filter
);
heap_
free
(
filter
);
free
(
filter
);
ObjectRefCount
(
FALSE
);
}
...
...
@@ -225,8 +225,7 @@ static HRESULT out_write(AviMux *This, const void *data, int size)
static
inline
HRESULT
idx1_add_entry
(
AviMux
*
avimux
,
DWORD
ckid
,
DWORD
flags
,
DWORD
off
,
DWORD
len
)
{
if
(
avimux
->
idx1_entries
==
avimux
->
idx1_size
)
{
AVIINDEXENTRY
*
new_idx
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
avimux
->
idx1
,
sizeof
(
*
avimux
->
idx1
)
*
2
*
avimux
->
idx1_size
);
AVIINDEXENTRY
*
new_idx
=
realloc
(
avimux
->
idx1
,
sizeof
(
*
avimux
->
idx1
)
*
2
*
avimux
->
idx1_size
);
if
(
!
new_idx
)
return
E_OUTOFMEMORY
;
...
...
@@ -576,8 +575,7 @@ static HRESULT avi_mux_init_stream(struct strmbase_filter *iface)
This
->
idx1_entries
=
0
;
if
(
!
This
->
idx1_size
)
{
This
->
idx1_size
=
1024
;
This
->
idx1
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
->
idx1
)
*
This
->
idx1_size
);
if
(
!
This
->
idx1
)
if
(
!
(
This
->
idx1
=
malloc
(
sizeof
(
*
This
->
idx1
)
*
This
->
idx1_size
)))
return
E_OUTOFMEMORY
;
}
...
...
@@ -1433,7 +1431,7 @@ static HRESULT avi_mux_sink_connect(struct strmbase_sink *iface, IPin *peer, con
return
hr
;
size
=
pmt
->
cbFormat
-
FIELD_OFFSET
(
VIDEOINFOHEADER
,
bmiHeader
);
avimuxin
->
strf
=
CoTaskMemA
lloc
(
sizeof
(
RIFFCHUNK
)
+
ALIGN
(
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
vih
->
bmiHeader
.
biClrUsed
])));
avimuxin
->
strf
=
ma
lloc
(
sizeof
(
RIFFCHUNK
)
+
ALIGN
(
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
vih
->
bmiHeader
.
biClrUsed
])));
avimuxin
->
strf
->
fcc
=
ckidSTREAMFORMAT
;
avimuxin
->
strf
->
cb
=
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
vih
->
bmiHeader
.
biClrUsed
]);
if
(
size
>
avimuxin
->
strf
->
cb
)
...
...
@@ -1467,7 +1465,7 @@ static void avi_mux_sink_disconnect(struct strmbase_sink *iface)
if
(
cur
==
avimuxin
->
samples_head
)
avimuxin
->
samples_head
=
NULL
;
}
CoTaskMemF
ree
(
avimuxin
->
strf
);
f
ree
(
avimuxin
->
strf
);
avimuxin
->
strf
=
NULL
;
}
...
...
@@ -1786,7 +1784,7 @@ static HRESULT create_input_pin(AviMux *avimux)
swprintf
(
name
,
ARRAY_SIZE
(
name
),
L"Input %02u"
,
avimux
->
input_pin_no
+
1
);
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
strmbase_sink_init
(
&
object
->
pin
,
&
avimux
->
filter
,
name
,
&
sink_ops
,
NULL
);
...
...
@@ -1800,7 +1798,7 @@ static HRESULT create_input_pin(AviMux *avimux)
if
(
FAILED
(
hr
))
{
strmbase_sink_cleanup
(
&
object
->
pin
);
heap_
free
(
object
);
free
(
object
);
return
hr
;
}
...
...
@@ -1810,7 +1808,7 @@ static HRESULT create_input_pin(AviMux *avimux)
{
IMemAllocator_Release
(
object
->
samples_allocator
);
strmbase_sink_cleanup
(
&
object
->
pin
);
heap_
free
(
object
);
free
(
object
);
return
hr
;
}
...
...
@@ -1826,7 +1824,7 @@ HRESULT avi_mux_create(IUnknown *outer, IUnknown **out)
AviMux
*
avimux
;
HRESULT
hr
;
if
(
!
(
avimux
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
AviMux
))))
if
(
!
(
avimux
=
calloc
(
1
,
sizeof
(
AviMux
))))
return
E_OUTOFMEMORY
;
strmbase_filter_init
(
&
avimux
->
filter
,
outer
,
&
CLSID_AviDest
,
&
filter_ops
);
...
...
@@ -1846,7 +1844,7 @@ HRESULT avi_mux_create(IUnknown *outer, IUnknown **out)
if
(
FAILED
(
hr
))
{
strmbase_source_cleanup
(
&
avimux
->
source
);
strmbase_filter_cleanup
(
&
avimux
->
filter
);
HeapFree
(
GetProcessHeap
(),
0
,
avimux
);
free
(
avimux
);
return
hr
;
}
...
...
dlls/qcap/capturegraph.c
View file @
b0b63aec
...
...
@@ -55,7 +55,7 @@ HRESULT capture_graph_create(IUnknown *outer, IUnknown **out)
if
(
outer
)
return
CLASS_E_NOAGGREGATION
;
if
(
!
(
object
=
CoTaskMemAlloc
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
ICaptureGraphBuilder2_iface
.
lpVtbl
=
&
builder2_Vtbl
;
...
...
@@ -122,7 +122,7 @@ static ULONG WINAPI fnCaptureGraphBuilder2_Release(ICaptureGraphBuilder2 * iface
DeleteCriticalSection
(
&
This
->
csFilter
);
if
(
This
->
mygraph
)
IGraphBuilder_Release
(
This
->
mygraph
);
CoTaskMemF
ree
(
This
);
f
ree
(
This
);
ObjectRefCount
(
FALSE
);
}
return
ref
;
...
...
dlls/qcap/filewriter.c
View file @
b0b63aec
...
...
@@ -161,10 +161,10 @@ static void file_writer_destroy(struct strmbase_filter *iface)
{
struct
file_writer
*
filter
=
impl_from_strmbase_filter
(
iface
);
heap_
free
(
filter
->
filename
);
free
(
filter
->
filename
);
strmbase_sink_cleanup
(
&
filter
->
sink
);
strmbase_filter_cleanup
(
&
filter
->
filter
);
heap_
free
(
filter
);
free
(
filter
);
}
static
HRESULT
file_writer_init_stream
(
struct
strmbase_filter
*
iface
)
...
...
@@ -245,11 +245,10 @@ static HRESULT WINAPI filesinkfilter_SetFileName(IFileSinkFilter *iface,
if
(
mt
)
FIXME
(
"Ignoring media type %p.
\n
"
,
mt
);
if
(
!
(
new_filename
=
heap_alloc
((
wcslen
(
filename
)
+
1
)
*
sizeof
(
WCHAR
)
)))
if
(
!
(
new_filename
=
wcsdup
(
filename
)))
return
E_OUTOFMEMORY
;
wcscpy
(
new_filename
,
filename
);
heap_
free
(
filter
->
filename
);
free
(
filter
->
filename
);
filter
->
filename
=
new_filename
;
return
S_OK
;
}
...
...
@@ -317,7 +316,7 @@ HRESULT file_writer_create(IUnknown *outer, IUnknown **out)
{
struct
file_writer
*
object
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
strmbase_filter_init
(
&
object
->
filter
,
outer
,
&
CLSID_FileWriter
,
&
filter_ops
);
...
...
dlls/qcap/qcap_private.h
View file @
b0b63aec
...
...
@@ -26,7 +26,6 @@
#define NONAMELESSUNION
#include "dshow.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/strmbase.h"
extern
HINSTANCE
qcap_instance
DECLSPEC_HIDDEN
;
...
...
dlls/qcap/smartteefilter.c
View file @
b0b63aec
...
...
@@ -59,7 +59,7 @@ static void smart_tee_destroy(struct strmbase_filter *iface)
strmbase_source_cleanup
(
&
filter
->
capture
);
strmbase_source_cleanup
(
&
filter
->
preview
);
strmbase_filter_cleanup
(
&
filter
->
filter
);
CoTaskMemF
ree
(
filter
);
f
ree
(
filter
);
}
static
HRESULT
smart_tee_wait_state
(
struct
strmbase_filter
*
iface
,
DWORD
timeout
)
...
...
@@ -319,9 +319,8 @@ HRESULT smart_tee_create(IUnknown *outer, IUnknown **out)
SmartTeeFilter
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
CoTaskMemAlloc
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
memset
(
object
,
0
,
sizeof
(
*
object
));
strmbase_filter_init
(
&
object
->
filter
,
outer
,
&
CLSID_SmartTee
,
&
filter_ops
);
strmbase_sink_init
(
&
object
->
sink
,
&
object
->
filter
,
L"Input"
,
&
sink_ops
,
NULL
);
...
...
@@ -330,7 +329,7 @@ HRESULT smart_tee_create(IUnknown *outer, IUnknown **out)
if
(
FAILED
(
hr
))
{
strmbase_filter_cleanup
(
&
object
->
filter
);
CoTaskMemF
ree
(
object
);
f
ree
(
object
);
return
hr
;
}
...
...
dlls/qcap/vfwcapture.c
View file @
b0b63aec
...
...
@@ -106,7 +106,7 @@ static void vfw_capture_destroy(struct strmbase_filter *iface)
DeleteCriticalSection
(
&
filter
->
state_cs
);
strmbase_source_cleanup
(
&
filter
->
source
);
strmbase_filter_cleanup
(
&
filter
->
filter
);
CoTaskMemF
ree
(
filter
);
f
ree
(
filter
);
ObjectRefCount
(
FALSE
);
}
...
...
@@ -852,7 +852,7 @@ HRESULT vfw_capture_create(IUnknown *outer, IUnknown **out)
if
(
!
InitOnceExecuteOnce
(
&
init_once
,
load_capture_funcs
,
NULL
,
NULL
)
||
!
capture_funcs
)
return
E_FAIL
;
if
(
!
(
object
=
CoTaskMemAlloc
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
strmbase_filter_init
(
&
object
->
filter
,
outer
,
&
CLSID_VfwCapture
,
&
filter_ops
);
...
...
@@ -862,7 +862,6 @@ HRESULT vfw_capture_create(IUnknown *outer, IUnknown **out)
object
->
IAMVideoProcAmp_iface
.
lpVtbl
=
&
IAMVideoProcAmp_VTable
;
object
->
IAMFilterMiscFlags_iface
.
lpVtbl
=
&
IAMFilterMiscFlags_VTable
;
object
->
IPersistPropertyBag_iface
.
lpVtbl
=
&
IPersistPropertyBag_VTable
;
object
->
init
=
FALSE
;
strmbase_source_init
(
&
object
->
source
,
&
object
->
filter
,
L"Output"
,
&
source_ops
);
...
...
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