[FFmpeg-devel] [PATCH v2 3/3] fftools/ffmpeg_opt: Check creation of new program

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sat Aug 27 18:19:58 EEST 2022


Fixes Coverity issue #1512413.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 fftools/ffmpeg_opt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index ccb79d920c..eddd421b70 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -2753,6 +2753,8 @@ static void of_add_programs(AVFormatContext *oc, const OptionsContext *o)
         }
 
         program = av_new_program(oc, progid);
+        if (!program)
+            report_and_exit(AVERROR(ENOMEM));
 
         p = o->program[i].u.str;
         while(*p) {
-- 
2.34.1



More information about the ffmpeg-devel mailing list