avfilter_formats_unref() should remove the given reference, not the last