[FFmpeg-devel] [PATCH] avfilter/vf_rotate: Check ff_draw_init2() return value

Michael Niedermayer michael at niedermayer.cc
Mon Jun 3 22:44:50 EEST 2024


Fixes: NULL pointer dereference
Fixes: 3_343

Found-by: De3mond
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavfilter/vf_rotate.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_rotate.c b/libavfilter/vf_rotate.c
index 3adde22c093..3e65f265527 100644
--- a/libavfilter/vf_rotate.c
+++ b/libavfilter/vf_rotate.c
@@ -288,7 +288,9 @@ static int config_props(AVFilterLink *outlink)
     double res;
     char *expr;
 
-    ff_draw_init2(&rot->draw, inlink->format, inlink->colorspace, inlink->color_range, 0);
+    ret = ff_draw_init2(&rot->draw, inlink->format, inlink->colorspace, inlink->color_range, 0);
+    if (ret < 0)
+        return ret;
     ff_draw_color(&rot->draw, &rot->color, rot->fillcolor);
 
     rot->hsub = pixdesc->log2_chroma_w;
-- 
2.45.1



More information about the ffmpeg-devel mailing list