diff mbox series

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

Message ID AM7PR03MB66603BF572289E614A74CE178FAD9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 806a91bd4c40ae8ed7c345dc320d6c111e8f3328
Headers show
Series [FFmpeg-devel,1/5] avfilter/vf_morpho: Fix leak of output frame on error | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 3, 2021, 9:48 a.m. UTC
Fixes heap-buffer underflows.

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

Comments

Paul B Mahol Oct. 3, 2021, 9:55 a.m. UTC | #1
ok
diff mbox series

Patch

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;