diff mbox series

[FFmpeg-devel,3/4] fftools/ffmpeg_filter: return an error on ofilter_alloc() failure

Message ID 20231107125835.25827-3-anton@khirnov.net
State Accepted
Commit 26ebd96371d8d32ea5c227e0b97af5bbd847332f
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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index c8920d9234..b7da105141 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -928,8 +928,10 @@  int fg_create(FilterGraph **pfg, char *graph_desc)
     for (AVFilterInOut *cur = outputs; cur; cur = cur->next) {
         OutputFilter *const ofilter = ofilter_alloc(fg);
 
-        if (!ofilter)
+        if (!ofilter) {
+            ret = AVERROR(ENOMEM);
             goto fail;
+        }
 
         ofilter->linklabel = cur->name;
         cur->name          = NULL;