summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec_asf.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-24 19:23:23 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-24 19:23:23 +0200
commit4641ae352ec587355764ffd5c43dd0d0ebd47654 (patch)
treeda175629ebf72bf55a504dd2d0240b1034892f4e /libavformat/rtpdec_asf.c
parente56425d1a71828c32f7f355f0979534e1007078f (diff)
avformat: Add and use ff_copy_whitelists()
Fixes potential security issue in case of running out of memory Found-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtpdec_asf.c')
-rw-r--r--libavformat/rtpdec_asf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c
index f21197aab2..8fd2e24afe 100644
--- a/libavformat/rtpdec_asf.c
+++ b/libavformat/rtpdec_asf.c
@@ -117,9 +117,10 @@ int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
rt->asf_ctx->pb = &pb;
av_dict_set(&opts, "no_resync_search", "1", 0);
- av_assert0(!rt->asf_ctx->codec_whitelist && !rt->asf_ctx->format_whitelist);
- rt->asf_ctx-> codec_whitelist = av_strdup(s->codec_whitelist);
- rt->asf_ctx->format_whitelist = av_strdup(s->format_whitelist);
+ if ((ret = ff_copy_whitelists(rt->asf_ctx, s)) < 0) {
+ av_dict_free(&opts);
+ return ret;
+ }
ret = avformat_open_input(&rt->asf_ctx, "", &ff_asf_demuxer, &opts);
av_dict_free(&opts);