[FFmpeg-devel] [PATCH]lavfi/avfiltergraph: Do not return ENOMEM if filter is missing

Nicolas George george at nsup.org
Sun Jun 17 19:47:09 EEST 2018


Mark Thompson (2018-06-17):
> There is AVERROR_FILTER_NOT_FOUND - while it isn't currently returned
> from lavfi, it does sound exactly right for this.

It is not exactly right for this, because this can be ENOMEM too.

Furthermore, this error code is really wrong, because this function does
not search for a filter, it takes it as an argument, and the argument
should not be NULL. Therefore, in this particular instance, the correct
fix would be to replace the initial check in ff_filter_alloc() by an
assert.

> (An alternative would be to check beforehand whether the filter name
> exists?  Not sure if that's really any better.)

It is not a filter name, it is a filter that was already checked.
Calling avfilter_graph_create_filter() with a NULL filter makes no sense
and is not allowed by the documented API. Adding a check before is
necessary.

Regards,

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


More information about the ffmpeg-devel mailing list