[FFmpeg-devel] [PATCH 1/2] lavfi: check links properties after configuring them.

Clément Bœsch u at pkh.me
Wed Nov 1 23:56:24 EET 2017


On Wed, Nov 01, 2017 at 09:39:52PM +0100, Nicolas George wrote:
> For now, check the image size.
> Inspired by a patch from Paul B Mahol.
> 
> Invalid sizes would be detected later by allocation failures,
> detecting problems earlier is cleaner.
> 
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  libavfilter/avfiltergraph.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
> index 69cf26896d..a009e0a760 100644
> --- a/libavfilter/avfiltergraph.c
> +++ b/libavfilter/avfiltergraph.c
> @@ -28,6 +28,7 @@
>  #include "libavutil/avstring.h"
>  #include "libavutil/bprint.h"
>  #include "libavutil/channel_layout.h"
> +#include "libavutil/imgutils.h"
>  #include "libavutil/internal.h"
>  #include "libavutil/opt.h"
>  #include "libavutil/pixdesc.h"
> @@ -263,6 +264,27 @@ static int graph_config_links(AVFilterGraph *graph, AVClass *log_ctx)
>      return 0;
>  }
>  
> +static int graph_check_links(AVFilterGraph *graph, AVClass *log_ctx)
> +{
> +    AVFilterContext *f;
> +    AVFilterLink *l;

> +    unsigned i, j;

nb_filters and nb_outputs are signed so the counters better be the same
type.

I think we already had that discussion but I'd rather have the counters
signed so the compiler can exploit the undefined property of signed
overflow to assume it will never happen.

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171101/6903f659/attachment.sig>


More information about the ffmpeg-devel mailing list