1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

avfilter/avfiltergraph: fix check for negative return

Before this commit if allocation would fail in ff_add_channel_layout()
function, function would return negative error code and this would
cause wrong format pick up later. If allocation would not fail return
code would be 0 and then format negotiation would simply fail as code
would break from the loop but with wrong return code.

Error was introduced in 6aaac24d72 commit.

Fixes #6638
This commit is contained in:
Paul B Mahol
2023-05-12 21:01:41 +02:00
parent 8564b4ab05
commit ee6ef66d65

View File

@@ -748,7 +748,9 @@ static int reduce_formats_on_filter(AVFilterContext *filter)
(KNOWN(fmt) || fmts->all_counts)) { (KNOWN(fmt) || fmts->all_counts)) {
/* Turn the infinite list into a singleton */ /* Turn the infinite list into a singleton */
fmts->all_layouts = fmts->all_counts = 0; fmts->all_layouts = fmts->all_counts = 0;
if (ff_add_channel_layout(&outlink->incfg.channel_layouts, fmt) < 0) ret = ff_add_channel_layout(&outlink->incfg.channel_layouts, fmt);
if (ret < 0)
return ret;
ret = 1; ret = 1;
break; break;
} }