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

Anton Khirnov anton at khirnov.net
Tue Nov 7 14:58:34 EET 2023


---
 fftools/ffmpeg_filter.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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;
-- 
2.42.0



More information about the ffmpeg-devel mailing list