avfilter/vf_fieldmatch: fix heap-buffer overflow

Also fix use of uninitialized values.

Fixes #8239

(cherry picked from commit ce5274c138)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Paul B Mahol 2019-10-19 11:56:02 +02:00 committed by Michael Niedermayer
parent 77b61358aa
commit b116c7a6b0
1 changed files with 1 additions and 1 deletions

View File

@ -938,7 +938,7 @@ static int config_input(AVFilterLink *inlink)
fm->tpitchy = FFALIGN(w, 16); fm->tpitchy = FFALIGN(w, 16);
fm->tpitchuv = FFALIGN(w >> 1, 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) * fm->c_array = av_malloc((((w + fm->blockx/2)/fm->blockx)+1) *
(((h + fm->blocky/2)/fm->blocky)+1) * (((h + fm->blocky/2)/fm->blocky)+1) *
4 * sizeof(*fm->c_array)); 4 * sizeof(*fm->c_array));