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
4733a12d
Commit
4733a12d
authored
Jun 03, 2015
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtpdec_asf: Check memory allocation and free memory on error
CC: libav-stable@libav.org Bug-Id: CID 1257774
parent
6308cd48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
rtpdec_asf.c
libavformat/rtpdec_asf.c
+10
-2
No files found.
libavformat/rtpdec_asf.c
View file @
4733a12d
...
...
@@ -102,6 +102,9 @@ int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
AVDictionary
*
opts
=
NULL
;
int
len
=
strlen
(
p
)
*
6
/
8
;
char
*
buf
=
av_mallocz
(
len
);
if
(
!
buf
)
return
AVERROR
(
ENOMEM
);
av_base64_decode
(
buf
,
p
,
len
);
if
(
rtp_asf_fix_header
(
buf
,
len
)
<
0
)
...
...
@@ -111,14 +114,19 @@ int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
if
(
rt
->
asf_ctx
)
{
avformat_close_input
(
&
rt
->
asf_ctx
);
}
if
(
!
(
rt
->
asf_ctx
=
avformat_alloc_context
()))
rt
->
asf_ctx
=
avformat_alloc_context
();
if
(
!
rt
->
asf_ctx
)
{
av_free
(
buf
);
return
AVERROR
(
ENOMEM
);
}
rt
->
asf_ctx
->
pb
=
&
pb
;
av_dict_set
(
&
opts
,
"no_resync_search"
,
"1"
,
0
);
ret
=
avformat_open_input
(
&
rt
->
asf_ctx
,
""
,
&
ff_asf_demuxer
,
&
opts
);
av_dict_free
(
&
opts
);
if
(
ret
<
0
)
if
(
ret
<
0
)
{
av_free
(
buf
);
return
ret
;
}
av_dict_copy
(
&
s
->
metadata
,
rt
->
asf_ctx
->
metadata
,
0
);
rt
->
asf_pb_pos
=
avio_tell
(
&
pb
);
av_free
(
buf
);
...
...
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