aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-19 11:56:02 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-05-04 20:00:05 +0200
commitb116c7a6b05d96845ebc490e916e7cc3d90c1249 (patch)
tree7af221466e29cdceed07efb2e070ef00c5021605 /libavfilter
parent77b61358aa0da73521cc181ccd56f7634a99c632 (diff)
downloadffmpeg-b116c7a6b05d96845ebc490e916e7cc3d90c1249.tar.gz
avfilter/vf_fieldmatch: fix heap-buffer overflow
Also fix use of uninitialized values. Fixes #8239 (cherry picked from commit ce5274c1385d55892a692998923802023526b765) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_fieldmatch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c
index 5a73eb43b8..8d1e68b85f 100644
--- a/libavfilter/vf_fieldmatch.c
+++ b/libavfilter/vf_fieldmatch.c
@@ -938,7 +938,7 @@ static int config_input(AVFilterLink *inlink)
fm->tpitchy = FFALIGN(w, 16);
fm->tpitchuv = FFALIGN(w >> 1, 16);
- fm->tbuffer = av_malloc(h/2 * fm->tpitchy);
+ fm->tbuffer = av_calloc((h/2 + 4) * fm->tpitchy, sizeof(*fm->tbuffer));
fm->c_array = av_malloc((((w + fm->blockx/2)/fm->blockx)+1) *
(((h + fm->blocky/2)/fm->blocky)+1) *
4 * sizeof(*fm->c_array));