[FFmpeg-devel] [PATCH]lavc/libx26x: Allow to fail if wrong options were passed

Carl Eugen Hoyos cehoyos at ag.or.at
Thu Jan 28 11:35:41 CET 2016


Hi!

Attached patch tries to address ticket #4947.
(only tested with libx264)

Please review, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 88406a3..c0e327e 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -781,6 +781,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
                     av_log(avctx, AV_LOG_WARNING,
                            "Error parsing option '%s = %s'.\n",
                             en->key, en->value);
+                    if (avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT)
+                        return AVERROR_INVALIDDATA;
             }
 
             av_dict_free(&dict);
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index a1770fa..b84b1d2 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -194,10 +194,14 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
                 case X265_PARAM_BAD_NAME:
                     av_log(avctx, AV_LOG_WARNING,
                           "Unknown option: %s.\n", en->key);
+                    if (avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT)
+                        return AVERROR_INVALIDDATA;
                     break;
                 case X265_PARAM_BAD_VALUE:
                     av_log(avctx, AV_LOG_WARNING,
                           "Invalid value for %s: %s.\n", en->key, en->value);
+                    if (avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT)
+                        return AVERROR_INVALIDDATA;
                     break;
                 default:
                     break;


More information about the ffmpeg-devel mailing list