You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02: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