diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-24 19:23:23 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-24 19:23:23 +0200 |
commit | 4641ae352ec587355764ffd5c43dd0d0ebd47654 (patch) | |
tree | da175629ebf72bf55a504dd2d0240b1034892f4e /libavformat/sapdec.c | |
parent | e56425d1a71828c32f7f355f0979534e1007078f (diff) | |
download | ffmpeg-4641ae352ec587355764ffd5c43dd0d0ebd47654.tar.gz |
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/sapdec.c')
-rw-r--r-- | libavformat/sapdec.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavformat/sapdec.c b/libavformat/sapdec.c index dbef1d2bee..2dd8524bce 100644 --- a/libavformat/sapdec.c +++ b/libavformat/sapdec.c @@ -160,9 +160,8 @@ static int sap_read_header(AVFormatContext *s) sap->sdp_ctx->pb = &sap->sdp_pb; sap->sdp_ctx->interrupt_callback = s->interrupt_callback; - av_assert0(!sap->sdp_ctx->codec_whitelist && !sap->sdp_ctx->format_whitelist); - sap->sdp_ctx-> codec_whitelist = av_strdup(s->codec_whitelist); - sap->sdp_ctx->format_whitelist = av_strdup(s->format_whitelist); + if ((ret = ff_copy_whitelists(sap->sdp_ctx, s)) < 0) + goto fail; ret = avformat_open_input(&sap->sdp_ctx, "temp.sdp", infmt, NULL); if (ret < 0) |