diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-13 06:29:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-14 01:17:06 +0100 |
commit | 8d95eb6702b46cd07385c5478b10924ea78e6f18 (patch) | |
tree | 243d7dc9b582968d9e8bfd4777e6f0fbc7423004 /libavcodec | |
parent | dd55adb1a704983482e3839a3a509d416d84d36a (diff) | |
download | ffmpeg-8d95eb6702b46cd07385c5478b10924ea78e6f18.tar.gz |
lavc: Prevent opening of experimental codecs if strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL.
Some of these encoders may produce invalid bitstreams, which should not
be done without the user knowing.
Some of these decoders may be unfinished and may contain security issues.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/utils.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 77811b0f91..78bc6e7626 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -703,6 +703,13 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD if ((ret = av_opt_set_dict(avctx, &tmp)) < 0) goto free_and_end; + if (codec->capabilities & CODEC_CAP_EXPERIMENTAL) + if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { + av_log(avctx, AV_LOG_ERROR, "Codec is experimental but experimental codecs are not enabled, see -strict -2\n"); + ret = -1; + goto free_and_end; + } + //We only call avcodec_set_dimensions() for non h264 codecs so as not to overwrite previously setup dimensions if(!( avctx->coded_width && avctx->coded_height && avctx->width && avctx->height && avctx->codec_id == CODEC_ID_H264)){ if(avctx->coded_width && avctx->coded_height) |