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
322428c8
Commit
322428c8
authored
Apr 04, 2013
by
highgod0401
Committed by
Michael Niedermayer
Apr 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/opencl: check strtol for failure
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
39406ea3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
opencl.c
libavutil/opencl.c
+13
-2
No files found.
libavutil/opencl.c
View file @
322428c8
...
@@ -518,6 +518,7 @@ int av_opencl_init(AVDictionary *options, AVOpenCLExternalEnv *ext_opencl_env)
...
@@ -518,6 +518,7 @@ int av_opencl_init(AVDictionary *options, AVOpenCLExternalEnv *ext_opencl_env)
AVDictionaryEntry
*
opt_build_entry
;
AVDictionaryEntry
*
opt_build_entry
;
AVDictionaryEntry
*
opt_platform_entry
;
AVDictionaryEntry
*
opt_platform_entry
;
AVDictionaryEntry
*
opt_device_entry
;
AVDictionaryEntry
*
opt_device_entry
;
char
*
pos
;
LOCK_OPENCL
LOCK_OPENCL
if
(
!
gpu_env
.
init_count
)
{
if
(
!
gpu_env
.
init_count
)
{
opt_platform_entry
=
av_dict_get
(
options
,
"platform_idx"
,
NULL
,
0
);
opt_platform_entry
=
av_dict_get
(
options
,
"platform_idx"
,
NULL
,
0
);
...
@@ -526,10 +527,20 @@ int av_opencl_init(AVDictionary *options, AVOpenCLExternalEnv *ext_opencl_env)
...
@@ -526,10 +527,20 @@ int av_opencl_init(AVDictionary *options, AVOpenCLExternalEnv *ext_opencl_env)
gpu_env
.
usr_spec_dev_info
.
platform_idx
=
-
1
;
gpu_env
.
usr_spec_dev_info
.
platform_idx
=
-
1
;
gpu_env
.
usr_spec_dev_info
.
dev_idx
=
-
1
;
gpu_env
.
usr_spec_dev_info
.
dev_idx
=
-
1
;
if
(
opt_platform_entry
)
{
if
(
opt_platform_entry
)
{
gpu_env
.
usr_spec_dev_info
.
platform_idx
=
strtol
(
opt_platform_entry
->
value
,
NULL
,
10
);
gpu_env
.
usr_spec_dev_info
.
platform_idx
=
strtol
(
opt_platform_entry
->
value
,
&
pos
,
10
);
if
(
pos
==
opt_platform_entry
->
value
)
{
av_log
(
&
openclutils
,
AV_LOG_ERROR
,
"Platform index should be a number
\n
"
);
ret
=
AVERROR
(
EINVAL
);
goto
end
;
}
}
}
if
(
opt_device_entry
)
{
if
(
opt_device_entry
)
{
gpu_env
.
usr_spec_dev_info
.
dev_idx
=
strtol
(
opt_device_entry
->
value
,
NULL
,
10
);
gpu_env
.
usr_spec_dev_info
.
dev_idx
=
strtol
(
opt_device_entry
->
value
,
&
pos
,
10
);
if
(
pos
==
opt_platform_entry
->
value
)
{
av_log
(
&
openclutils
,
AV_LOG_ERROR
,
"Device index should be a number
\n
"
);
ret
=
AVERROR
(
EINVAL
);
goto
end
;
}
}
}
ret
=
init_opencl_env
(
&
gpu_env
,
ext_opencl_env
);
ret
=
init_opencl_env
(
&
gpu_env
,
ext_opencl_env
);
if
(
ret
<
0
)
if
(
ret
<
0
)
...
...
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