diff mbox series

[FFmpeg-devel,2/4] fftools/ffmpeg_filter: fail on ifilter_alloc() failure

Message ID 20231107125835.25827-2-anton@khirnov.net
State Accepted
Commit 5db07311a073a7ce7f2ea72bd80049403f3f7589
Headers show
Series [FFmpeg-devel,1/4] fftools/cmdutils: only set array size after allocation succeeded | 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

Anton Khirnov Nov. 7, 2023, 12:58 p.m. UTC
---
 fftools/ffmpeg_filter.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index c738fc3397..c8920d9234 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -905,8 +905,14 @@  int fg_create(FilterGraph **pfg, char *graph_desc)
 
     for (AVFilterInOut *cur = inputs; cur; cur = cur->next) {
         InputFilter *const ifilter = ifilter_alloc(fg);
-        InputFilterPriv       *ifp = ifp_from_ifilter(ifilter);
+        InputFilterPriv       *ifp;
 
+        if (!ifilter) {
+            ret = AVERROR(ENOMEM);
+            goto fail;
+        }
+
+        ifp            = ifp_from_ifilter(ifilter);
         ifp->linklabel = cur->name;
         cur->name      = NULL;