static int query_formats(AVFilterContext *ctx)
{
AVFilterFormats *pix_fmts = NULL;
- int fmt;
+ int fmt, ret;
for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
if (!(desc->flags & AV_PIX_FMT_FLAG_PAL ||
desc->flags & AV_PIX_FMT_FLAG_HWACCEL ||
desc->flags & AV_PIX_FMT_FLAG_BITSTREAM ||
- desc->log2_chroma_w != desc->log2_chroma_h))
- ff_add_format(&pix_fmts, fmt);
+ desc->log2_chroma_w != desc->log2_chroma_h) &&
+ (ret = ff_add_format(&pix_fmts, fmt)) < 0)
+ return ret;
}