int i;
int ret;
+ if (!s->pix_fmts)
+ return AVERROR(EINVAL);
+
/* count the formats */
cur = s->pix_fmts;
while ((cur = strchr(cur, '|'))) {
if (!s->formats)
return AVERROR(ENOMEM);
- if (!s->pix_fmts)
- return AVERROR(EINVAL);
-
/* parse the list of formats */
cur = s->pix_fmts;
for (i = 0; i < nb_formats; i++) {