Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
bb298967
Commit
bb298967
authored
Aug 25, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/opencl: use av_malloc(z)_array()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
52fca28c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
opencl.c
libavutil/opencl.c
+4
-4
No files found.
libavutil/opencl.c
View file @
bb298967
...
...
@@ -213,7 +213,7 @@ static int get_device_list(AVOpenCLDeviceList *device_list)
"Could not get OpenCL platform ids: %s
\n
"
,
av_opencl_errstr
(
status
));
return
AVERROR_EXTERNAL
;
}
platform_ids
=
av_mallocz
(
device_list
->
platform_num
*
sizeof
(
cl_platform_id
));
platform_ids
=
av_mallocz
_array
(
device_list
->
platform_num
,
sizeof
(
cl_platform_id
));
if
(
!
platform_ids
)
return
AVERROR
(
ENOMEM
);
status
=
clGetPlatformIDs
(
device_list
->
platform_num
,
platform_ids
,
NULL
);
...
...
@@ -223,7 +223,7 @@ static int get_device_list(AVOpenCLDeviceList *device_list)
ret
=
AVERROR_EXTERNAL
;
goto
end
;
}
device_list
->
platform_node
=
av_mallocz
(
device_list
->
platform_num
*
sizeof
(
AVOpenCLPlatformNode
*
));
device_list
->
platform_node
=
av_mallocz
_array
(
device_list
->
platform_num
,
sizeof
(
AVOpenCLPlatformNode
*
));
if
(
!
device_list
->
platform_node
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
...
...
@@ -249,14 +249,14 @@ static int get_device_list(AVOpenCLDeviceList *device_list)
device_type
[
j
],
0
,
NULL
,
&
devices_num
[
j
]);
total_devices_num
+=
devices_num
[
j
];
}
device_list
->
platform_node
[
i
]
->
device_node
=
av_mallocz
(
total_devices_num
*
sizeof
(
AVOpenCLDeviceNode
*
));
device_list
->
platform_node
[
i
]
->
device_node
=
av_mallocz
_array
(
total_devices_num
,
sizeof
(
AVOpenCLDeviceNode
*
));
if
(
!
device_list
->
platform_node
[
i
]
->
device_node
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
}
for
(
j
=
0
;
j
<
FF_ARRAY_ELEMS
(
device_type
);
j
++
)
{
if
(
devices_num
[
j
])
{
device_ids
=
av_mallocz
(
devices_num
[
j
]
*
sizeof
(
cl_device_id
));
device_ids
=
av_mallocz
_array
(
devices_num
[
j
],
sizeof
(
cl_device_id
));
if
(
!
device_ids
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
...
...
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