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
2351ea8a
Commit
2351ea8a
authored
Jun 09, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/nutenc: Fix error handling in write_sm_data()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
9c9eac5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
nutenc.c
libavformat/nutenc.c
+10
-5
No files found.
libavformat/nutenc.c
View file @
2351ea8a
...
...
@@ -849,14 +849,18 @@ static int write_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int
if
(
is_meta
)
{
if
(
pkt
->
side_data
[
i
].
type
==
AV_PKT_DATA_METADATA_UPDATE
||
pkt
->
side_data
[
i
].
type
==
AV_PKT_DATA_STRINGS_METADATA
)
{
if
(
!
size
||
data
[
size
-
1
])
return
AVERROR
(
EINVAL
);
if
(
!
size
||
data
[
size
-
1
])
{
ret
=
AVERROR
(
EINVAL
);
goto
fail
;
}
while
(
data
<
data_end
)
{
const
uint8_t
*
key
=
data
;
const
uint8_t
*
val
=
data
+
strlen
(
key
)
+
1
;
if
(
val
>=
data_end
)
return
AVERROR
(
EINVAL
);
if
(
val
>=
data_end
)
{
ret
=
AVERROR
(
EINVAL
);
goto
fail
;
}
put_str
(
dyn_bc
,
key
);
put_s
(
dyn_bc
,
-
1
);
put_str
(
dyn_bc
,
val
);
...
...
@@ -937,12 +941,13 @@ static int write_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int
}
}
fail:
ff_put_v
(
bc
,
sm_data_count
);
dyn_size
=
avio_close_dyn_buf
(
dyn_bc
,
&
dyn_buf
);
avio_write
(
bc
,
dyn_buf
,
dyn_size
);
av_freep
(
&
dyn_buf
);
return
0
;
return
ret
;
}
static
int
nut_write_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
...
...
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