mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 17:30:00 +01:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user