[FFmpeg-devel] [PATCH 3/5] avfilter/vf_morpho: Take pre-padding into account for LUT-reallocation

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sun Oct 3 12:48:16 EEST 2021


Fixes heap-buffer underflows.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavfilter/vf_morpho.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavfilter/vf_morpho.c b/libavfilter/vf_morpho.c
index d5c4801006..8c1e084e7e 100644
--- a/libavfilter/vf_morpho.c
+++ b/libavfilter/vf_morpho.c
@@ -320,6 +320,7 @@ static int alloc_lut_if_necessary(LUT *Ty, IPlane *f, chord_set *SE,
 {
     if (Ty->I != SE->Lnum ||
         Ty->X != f->w ||
+        SE->minX < 0 && -SE->minX > Ty->pre_pad_x ||
         Ty->min_r != SE->minY ||
         Ty->max_r != SE->maxY + num - 1) {
         int ret;
-- 
2.30.2



More information about the ffmpeg-devel mailing list