• Andreas Rheinhardt's avatar
    avfilter/graphparser: Fix memleak when linking filters fails · deb6476f
    Andreas Rheinhardt authored
    Parsing labeled outputs involves a check for an already known match
    (a labeled input with the same name) to pair them together. If yes,
    it is attempted to create a link between the two filters; in this case
    the AVFilterInOuts have fulfilled their purpose and are freed. Yet if
    creating the link fails, these AVFilterInOuts have up until now not been
    freed, although they had already been removed from their respective lists
    (which means that they are not freed automatically). In other words:
    They leak. This commit fixes this.
    
    This fixes ticket #7084. Said ticket contains an example program to
    reproduce a leak. It can also be reproduced with ffmpeg alone, e.g. with
    the complex filters "[0]null[1],[2]anull[0]" or with "[0]abitscope[0]".
    All of these three examples involve media type mismatches which make it
    impossible to create the links. The bug could also be triggered by other
    means, e.g. failure to allocate the necessary AVFilterLink.
    Reviewed-by: 's avatarNicolas George <george@nsup.org>
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    deb6476f
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...