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
1c5b56ee
Commit
1c5b56ee
authored
Nov 04, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vocenc: abort if unsupported codec is used
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
4a2599b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
vocenc.c
libavformat/vocenc.c
+6
-0
No files found.
libavformat/vocenc.c
View file @
1c5b56ee
...
@@ -30,6 +30,7 @@ typedef struct voc_enc_context {
...
@@ -30,6 +30,7 @@ typedef struct voc_enc_context {
static
int
voc_write_header
(
AVFormatContext
*
s
)
static
int
voc_write_header
(
AVFormatContext
*
s
)
{
{
AVIOContext
*
pb
=
s
->
pb
;
AVIOContext
*
pb
=
s
->
pb
;
AVCodecContext
*
enc
=
s
->
streams
[
0
]
->
codec
;
const
int
header_size
=
26
;
const
int
header_size
=
26
;
const
int
version
=
0x0114
;
const
int
version
=
0x0114
;
...
@@ -37,6 +38,11 @@ static int voc_write_header(AVFormatContext *s)
...
@@ -37,6 +38,11 @@ static int voc_write_header(AVFormatContext *s)
||
s
->
streams
[
0
]
->
codec
->
codec_type
!=
AVMEDIA_TYPE_AUDIO
)
||
s
->
streams
[
0
]
->
codec
->
codec_type
!=
AVMEDIA_TYPE_AUDIO
)
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
if
(
!
enc
->
codec_tag
||
enc
->
codec_tag
>
0xffff
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"unsupported codec
\n
"
);
return
AVERROR
(
EINVAL
);
}
avio_write
(
pb
,
ff_voc_magic
,
sizeof
(
ff_voc_magic
)
-
1
);
avio_write
(
pb
,
ff_voc_magic
,
sizeof
(
ff_voc_magic
)
-
1
);
avio_wl16
(
pb
,
header_size
);
avio_wl16
(
pb
,
header_size
);
avio_wl16
(
pb
,
version
);
avio_wl16
(
pb
,
version
);
...
...
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