History

avfilter/buffersink: don't leak the reallocated channel layouts array

And ensure the last element is the zeroed terminator. Fixes ticket #11392.

James Almer committed 1 year ago

Commit 041a6c31 parent f7900a51 file · +2 −1Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/buffersink.c+2−1
@@ -205,8 +205,9 @@ static av_cold int common_init(AVFilterContext *ctx) · 204 unmodified lines
205205 if (!tmp)
206206 return AVERROR(ENOMEM);
207207
208+ buf->channel_layouts = tmp;
208209 memset(&buf->channel_layouts[buf->nb_channel_layouts], 0,
209− sizeof(*buf->channel_layouts));
210+ sizeof(*buf->channel_layouts) * 2);
210211 buf->nb_channel_layouts++;
211212
212213 ret = av_channel_layout_from_string(&buf->channel_layouts[buf->nb_channel_layouts - 1], cur);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t