]> git.sesse.net Git - ffmpeg/commit
avfilter/vf_unsharp: Don't dereference NULL
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 1 Dec 2019 09:56:26 +0000 (10:56 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 3 Dec 2019 08:50:00 +0000 (09:50 +0100)
commit710ab136931ff228b355d87512b0d4ca4e94656a
tree7f062d8be54435f40da8e0a3674af327dc874b9b
parent968c4cbf22813b203b77e9144164abff914234e6
avfilter/vf_unsharp: Don't dereference NULL

The unsharp filter uses an array of arrays of uint32_t, each of which is
separately allocated. These arrays also need to freed separately; but
before doing so, one needs to check whether the array of arrays has
actually been allocated, otherwise one would dereference a NULL pointer.
This fixes #8408.

Furthermore, the array of arrays needs to be zero-initialized so that
no uninitialized pointer will be freed in case an allocation of one of
the individual arrays fails.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/vf_unsharp.c