Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-19 12:56:02 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-05-04 19:35:04 +0300
commit93ad1e4a9f17ac5145c2957bb270a454c8a0cefd (patch)
treef4a4e9f006bb3b3bd2baaaa13874c1d24d414c21
parent02161c6ed194ddfa00fd2af7684a8099852bc3ce (diff)
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c
index c01af6681c..1196b95e92 100644
--- a/libavfilter/vf_fieldmatch.c
+++ b/libavfilter/vf_fieldmatch.c
@@ -882,7 +882,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));