Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
d4088efb
Commit
d4088efb
authored
Apr 07, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oggparsespeex: validate channel count and set channel layout
parent
232e9c4c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
oggparsespeex.c
libavformat/oggparsespeex.c
+7
-0
No files found.
libavformat/oggparsespeex.c
View file @
d4088efb
...
...
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include "libavutil/bswap.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavcodec/get_bits.h"
#include "libavcodec/bytestream.h"
#include "avformat.h"
...
...
@@ -59,6 +60,12 @@ static int speex_header(AVFormatContext *s, int idx) {
st
->
codec
->
sample_rate
=
AV_RL32
(
p
+
36
);
st
->
codec
->
channels
=
AV_RL32
(
p
+
48
);
if
(
st
->
codec
->
channels
<
1
||
st
->
codec
->
channels
>
2
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"invalid channel count. Speex must be mono or stereo.
\n
"
);
return
AVERROR_INVALIDDATA
;
}
st
->
codec
->
channel_layout
=
st
->
codec
->
channels
==
1
?
AV_CH_LAYOUT_MONO
:
AV_CH_LAYOUT_STEREO
;
spxp
->
packet_size
=
AV_RL32
(
p
+
56
);
frames_per_packet
=
AV_RL32
(
p
+
64
);
...
...
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