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

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Mon Aug 24 20:25:03 EEST 2020


Nicolas George:
> 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?
> 

The above check already contains "|| (!fmts->all_layouts &&
!fmts->nb_channel_layouts)". So if everything is zero, you get the error
for an inconsistent generic list.

>>
>>> +        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,
> 
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 



More information about the ffmpeg-devel mailing list