diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-10-19 11:56:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-05-04 18:34:53 +0200 |
commit | 0744d7176ae1027d5ad7de28b283a78d58e64545 (patch) | |
tree | 8c6e0f8ed66f9dbdc9329628c3b1a33a5cd7583b | |
parent | a95d2099b8edb6bb906751a7e27984de2d8930d8 (diff) | |
download | ffmpeg-0744d7176ae1027d5ad7de28b283a78d58e64545.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>
-rw-r--r-- | libavfilter/vf_fieldmatch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c index e155712caa..8c1bf19080 100644 --- a/libavfilter/vf_fieldmatch.c +++ b/libavfilter/vf_fieldmatch.c @@ -885,7 +885,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)); |