diff options
author | James Almer <jamrial@gmail.com> | 2025-01-01 19:39:34 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2025-01-01 19:42:11 -0300 |
commit | 041a6c36142f89addf2bc850f5bd27a089d900f5 (patch) | |
tree | 1883bb8aa837444c88af215bf17bc2942f6d9d80 /libavfilter/buffersink.c | |
parent | f7900a560983ce364eff2a5b9d6a54269999f717 (diff) | |
download | ffmpeg-041a6c36142f89addf2bc850f5bd27a089d900f5.tar.gz |
avfilter/buffersink: don't leak the reallocated channel layouts array
And ensure the last element is the zeroed terminator.
Fixes ticket #11392.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavfilter/buffersink.c')
-rw-r--r-- | libavfilter/buffersink.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c index b0bcc26432..565d084ddf 100644 --- a/libavfilter/buffersink.c +++ b/libavfilter/buffersink.c @@ -205,8 +205,9 @@ static av_cold int common_init(AVFilterContext *ctx) if (!tmp) return AVERROR(ENOMEM); + buf->channel_layouts = tmp; memset(&buf->channel_layouts[buf->nb_channel_layouts], 0, - sizeof(*buf->channel_layouts)); + sizeof(*buf->channel_layouts) * 2); buf->nb_channel_layouts++; ret = av_channel_layout_from_string(&buf->channel_layouts[buf->nb_channel_layouts - 1], cur); |