From 4641ae352ec587355764ffd5c43dd0d0ebd47654 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 24 Oct 2014 19:23:23 +0200 Subject: 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 --- libavformat/mpeg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavformat/mpeg.c') diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 09af46e404..369affda0c 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -700,8 +700,8 @@ static int vobsub_read_header(AVFormatContext *s) if (!vobsub->sub_ctx) return AVERROR(ENOMEM); - vobsub->sub_ctx-> codec_whitelist = av_strdup(s->codec_whitelist); - vobsub->sub_ctx->format_whitelist = av_strdup(s->format_whitelist); + if ((ret = ff_copy_whitelists(vobsub->sub_ctx, s)) < 0) + goto end; ret = avformat_open_input(&vobsub->sub_ctx, sub_name, &ff_mpegps_demuxer, NULL); if (ret < 0) { -- cgit v1.2.3