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
8bcb4466
Commit
8bcb4466
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 heap_alloc().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8fa03e49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
v4l.c
dlls/qcap/v4l.c
+8
-8
No files found.
dlls/qcap/v4l.c
View file @
8bcb4466
...
...
@@ -116,9 +116,9 @@ static void v4l_device_destroy(struct video_capture_device *device)
if
(
device
->
fd
!=
-
1
)
video_close
(
device
->
fd
);
if
(
device
->
caps_count
)
heap_
free
(
device
->
caps
);
heap_
free
(
device
->
image_data
);
heap_
free
(
device
);
free
(
device
->
caps
);
free
(
device
->
image_data
);
free
(
device
);
}
static
const
struct
caps
*
find_caps
(
struct
video_capture_device
*
device
,
const
AM_MEDIA_TYPE
*
mt
)
...
...
@@ -167,7 +167,7 @@ static HRESULT set_caps(struct video_capture_device *device, const struct caps *
height
=
caps
->
video_info
.
bmiHeader
.
biHeight
;
image_size
=
width
*
height
*
caps
->
video_info
.
bmiHeader
.
biBitCount
/
8
;
if
(
!
(
image_data
=
heap_
alloc
(
image_size
)))
if
(
!
(
image_data
=
m
alloc
(
image_size
)))
{
ERR
(
"Failed to allocate memory.
\n
"
);
return
E_OUTOFMEMORY
;
...
...
@@ -183,14 +183,14 @@ static HRESULT set_caps(struct video_capture_device *device, const struct caps *
||
format
.
fmt
.
pix
.
height
!=
height
)
{
ERR
(
"Failed to set pixel format: %s.
\n
"
,
strerror
(
errno
));
heap_
free
(
image_data
);
free
(
image_data
);
return
VFW_E_TYPE_NOT_ACCEPTED
;
}
device
->
current_caps
=
caps
;
device
->
image_size
=
image_size
;
device
->
image_pitch
=
width
*
caps
->
video_info
.
bmiHeader
.
biBitCount
/
8
;
heap_
free
(
device
->
image_data
);
free
(
device
->
image_data
);
device
->
image_data
=
image_data
;
return
S_OK
;
}
...
...
@@ -407,7 +407,7 @@ struct video_capture_device *v4l_device_create(USHORT index)
have_libv4l2
=
video_init
();
if
(
!
(
device
=
heap_alloc_zero
(
sizeof
(
*
device
))))
if
(
!
(
device
=
calloc
(
1
,
sizeof
(
*
device
))))
return
NULL
;
sprintf
(
path
,
"/dev/video%i"
,
index
);
...
...
@@ -509,7 +509,7 @@ struct video_capture_device *v4l_device_create(USHORT index)
else
ERR
(
"Failed to get fps: %s.
\n
"
,
strerror
(
errno
));
new_caps
=
heap_
realloc
(
device
->
caps
,
(
device
->
caps_count
+
1
)
*
sizeof
(
*
device
->
caps
));
new_caps
=
realloc
(
device
->
caps
,
(
device
->
caps_count
+
1
)
*
sizeof
(
*
device
->
caps
));
if
(
!
new_caps
)
goto
error
;
device
->
caps
=
new_caps
;
...
...
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