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
7ad69a73
Commit
7ad69a73
authored
Oct 11, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_waveform: better guard against picking wrong pixel format
Fixes #8252
parent
e787f8fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
vf_waveform.c
libavfilter/vf_waveform.c
+9
-3
No files found.
libavfilter/vf_waveform.c
View file @
7ad69a73
...
...
@@ -290,9 +290,9 @@ static int query_formats(AVFilterContext *ctx)
WaveformContext
*
s
=
ctx
->
priv
;
const
enum
AVPixelFormat
*
out_pix_fmts
;
const
enum
AVPixelFormat
*
in_pix_fmts
;
const
AVPixFmtDescriptor
*
desc
;
AVFilterFormats
*
avff
;
int
depth
,
rgb
,
i
,
ret
,
ncomp
;
const
AVPixFmtDescriptor
*
desc
,
*
desc2
;
AVFilterFormats
*
avff
,
*
avff2
;
int
depth
,
depth2
,
rgb
,
i
,
ret
,
ncomp
,
ncomp2
;
if
(
!
ctx
->
inputs
[
0
]
->
in_formats
||
!
ctx
->
inputs
[
0
]
->
in_formats
->
nb_formats
)
{
...
...
@@ -316,10 +316,16 @@ static int query_formats(AVFilterContext *ctx)
}
avff
=
ctx
->
inputs
[
0
]
->
in_formats
;
avff2
=
ctx
->
inputs
[
0
]
->
out_formats
;
desc
=
av_pix_fmt_desc_get
(
avff
->
formats
[
0
]);
desc2
=
av_pix_fmt_desc_get
(
avff2
->
formats
[
0
]);
ncomp
=
desc
->
nb_components
;
ncomp2
=
desc2
->
nb_components
;
rgb
=
desc
->
flags
&
AV_PIX_FMT_FLAG_RGB
;
depth
=
desc
->
comp
[
0
].
depth
;
depth2
=
desc2
->
comp
[
0
].
depth
;
if
(
ncomp
!=
ncomp2
||
depth
!=
depth2
)
return
AVERROR
(
EAGAIN
);
for
(
i
=
1
;
i
<
avff
->
nb_formats
;
i
++
)
{
desc
=
av_pix_fmt_desc_get
(
avff
->
formats
[
i
]);
if
(
rgb
!=
(
desc
->
flags
&
AV_PIX_FMT_FLAG_RGB
)
||
...
...
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