avfilter/REDUCE_FORMATS: fix bug that ended reducing too early