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

Nicolas George george at nsup.org
Thu Jan 28 11:37:42 CET 2016


Le nonidi 9 pluviôse, an CCXXIV, Carl Eugen Hoyos a écrit :
> Hi!
> 
> Attached patch tries to address ticket #4947.
> (only tested with libx264)
> 
> Please review, Carl Eugen

> 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;

AVERROR(EINVAL) seems more correct. Same below.

>              }
>  
>              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;

No other remark, but I do not maintain these files.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160128/adcaf079/attachment.sig>


More information about the ffmpeg-devel mailing list