[FFmpeg-devel] [PATCH v3 3/4] lavfi: check the validity of formats lists.

Nicolas George george at nsup.org
Mon Aug 24 20:20:37 EEST 2020


Andreas Rheinhardt (12020-08-24):
> expects

> switch to

> preferred

Locally fixed.

> > +    if (fmts->all_layouts < fmts->all_counts ||
> > +        (!fmts->all_layouts && !fmts->nb_channel_layouts)) {
> 
> As has already been said in my review of the first version:
> This check doesn't fit to the error message and it also makes the next
> check below dead code.

I missed the first review, sorry.

The error message is correct: it is inconsistent to accept all counts
without accepting all layouts.

And the next test is not dead code: if all_counts and all_layouts are 0,
and nb_channel_layouts is also 0, it is triggered.

Or am I missing something?

> 
> > +        av_log(log, AV_LOG_ERROR, "Inconsistent generic list\n");
> > +        return AVERROR(EINVAL);
> > +    }
> > +    if (!fmts->all_layouts && !fmts->nb_channel_layouts) {
> > +        av_log(log, AV_LOG_ERROR, "Empty channel layout list\n");
> > +        return AVERROR(EINVAL);
> > +    }

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200824/ed1d3215/attachment.sig>


More information about the ffmpeg-devel mailing list