diff mbox series

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

Message ID 20240603194450.3439361-1-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel] avfilter/vf_rotate: Check ff_draw_init2() return value | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer June 3, 2024, 7:44 p.m. UTC
Fixes: NULL pointer dereference
Fixes: 3_343

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

Comments

Michael Niedermayer June 11, 2024, 10:14 p.m. UTC | #1
On Mon, Jun 03, 2024 at 09:44:50PM +0200, Michael Niedermayer wrote:
> Fixes: NULL pointer dereference
> Fixes: 3_343
> 
> Found-by: De3mond
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/vf_rotate.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

will apply

[...]
diff mbox series

Patch

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;