diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-08-07 17:31:11 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-08-23 23:26:15 +0200 |
commit | 44e376500fd0a5e6b9ca1611e645feeb50de1ac5 (patch) | |
tree | 705cea6dafe3d3368c4a9c0e1aae711e6f3c08fe /RELEASE | |
parent | 27f35fd121e38b28daafb4f1ad47cf55b5e5ab71 (diff) | |
download | ffmpeg-44e376500fd0a5e6b9ca1611e645feeb50de1ac5.tar.gz |
avfilter/af_amix: Fix double-free of AVFilterChannelLayouts on error
The query_formats function of the amix filter tries to allocate a list
of channel layouts which are attached to more permanent objects
(an AVFilter's links) for storage afterwards on success. If attaching
a list to a link succeeds, the link becomes one of the common owners
of the list. Yet if a list has been successfully attached to links (or if
there were no links to attach it to in which case
ff_set_common_channel_layouts() already frees the list) and an error
happens lateron, the list was manually freed, which is wrong, because
the list has either already been freed or it is owned by its links in
which case these links' pointers to their list will become dangling and
there will be double-frees/uses-after-free when these links are cleaned
up automatically.
This commit fixes this by removing the custom freeing code; this is made
possible by using the list in ff_set_common_channel_layouts() directly
after its allocation (without anything that can fail in between).
Notice that ff_set_common_channel_layouts() is buggy itself which can
lead to double-frees on error. This is not fixed in this commit.
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'RELEASE')
0 files changed, 0 insertions, 0 deletions