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
c22953b8
Commit
c22953b8
authored
May 07, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: check that extended_data is properly set in avcodec_encode_audio2().
parent
a5117a24
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
utils.c
libavcodec/utils.c
+17
-0
No files found.
libavcodec/utils.c
View file @
c22953b8
...
...
@@ -908,6 +908,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
const
AVFrame
*
frame
,
int
*
got_packet_ptr
)
{
AVFrame
tmp
;
AVFrame
*
padded_frame
=
NULL
;
int
ret
;
int
user_packet
=
!!
avpkt
->
data
;
...
...
@@ -920,6 +921,22 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
return
0
;
}
/* ensure that extended_data is properly set */
if
(
frame
&&
!
frame
->
extended_data
)
{
if
(
av_sample_fmt_is_planar
(
avctx
->
sample_fmt
)
&&
avctx
->
channels
>
AV_NUM_DATA_POINTERS
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Encoding to a planar sample format, "
"with more than %d channels, but extended_data is not set.
\n
"
,
AV_NUM_DATA_POINTERS
);
return
AVERROR
(
EINVAL
);
}
av_log
(
avctx
,
AV_LOG_WARNING
,
"extended_data is not set.
\n
"
);
tmp
=
*
frame
;
tmp
.
extended_data
=
tmp
.
data
;
frame
=
&
tmp
;
}
/* check for valid frame size */
if
(
frame
)
{
if
(
avctx
->
codec
->
capabilities
&
CODEC_CAP_SMALL_LAST_FRAME
)
{
...
...
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