]> git.sesse.net Git - ffmpeg/commit
avfilter/af_amerge: Fix segfault upon allocation failure
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 24 Aug 2020 03:46:08 +0000 (05:46 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 25 Aug 2020 22:20:50 +0000 (00:20 +0200)
commit8f2c1f2cbe77685435362f1940b637a6c3ff1934
tree49044588b13bfbc71830f6406a60207e0d22bf8e
parentae5369128aae77fae82b808b0805ef8e2596d95d
avfilter/af_amerge: Fix segfault upon allocation failure

The amerge filter uses a variable number of inpads and allocates them
in its init function; if all goes well, the number of inpads coincides
with a number stored in the filter's private context. Yet if allocating a
subsequent inpad fails, the uninit function nevertheless uses the number
stored in the private context to determine the number of inpads to free
and not the AVFilterContext's nb_inputs. This will lead to an access
beyond the end of the allocated AVFilterContext.input_pads array and
an invalid free.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavfilter/af_amerge.c