Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
716ecf5a
Commit
716ecf5a
authored
Jun 03, 2024
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/asubprocess: verify extended wav format guid if available
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
17633ac6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
af_asubprocess.c
libavfilter/af_asubprocess.c
+19
-2
No files found.
libavfilter/af_asubprocess.c
View file @
716ecf5a
...
...
@@ -53,7 +53,7 @@ enum {
STATE_SKIP_CHUNK
,
STATE_IN_DATA_CHUNK
,
STATE_IN_FMT_CHUNK
,
STATE_E
RROR
STATE_E
XT_FMT
};
typedef
struct
ASubProcessContext
{
...
...
@@ -287,7 +287,7 @@ static int process_input(AVFilterContext *ctx)
sample_rate
=
AV_RL32
(
data
+
4
);
s
->
out_bit_depth
=
AV_RL16
(
data
+
14
);
if
(
format
!=
1
&&
format
!=
0xFFFE
)
{
// TODO: check extensible wav format: should be PCM
if
(
format
!=
1
&&
format
!=
0xFFFE
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Unsupported wav format (%d) from subprocess (expected PCM).
\n
"
,
format
);
return
AVERROR_INVALIDDATA
;
...
...
@@ -309,6 +309,23 @@ static int process_input(AVFilterContext *ctx)
return
AVERROR_INVALIDDATA
;
}
s
->
chunk_size
-=
16
;
if
(
format
=
0xFFFE
)
s
->
state
=
STATE_EXT_FMT
;
else
s
->
state
=
STATE_SKIP_CHUNK
;
}
else
if
(
s
->
state
==
STATE_EXT_FMT
&&
can_read
>=
24
)
{
unsigned
char
data
[
24
];
static
const
unsigned
char
pcm_fmt_guid
[
16
]
=
{
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x10
,
0x00
,
0x80
,
0x00
,
0x00
,
0xAA
,
0x00
,
0x38
,
0x9B
,
0x71
};
sp_read
(
s
->
sp
,
data
,
24
);
if
(
memcmp
(
data
+
8
,
pcm_fmt
,
16
))
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Unsupported extended wav format from subprocess (expected PCM).
\n
"
);
return
AVERROR_INVALIDDATA
;
}
s
->
chunk_size
-=
24
;
s
->
state
=
STATE_SKIP_CHUNK
;
}
else
if
(
s
->
state
==
STATE_SKIP_CHUNK
&&
can_read
>
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