[FFmpeg-devel] [PATCH 2/2] avformat/mpegtsenc: Remove redundant goto after malloc fail

Andriy Gelman andriy.gelman at gmail.com
Thu Aug 1 01:37:56 EEST 2019


From: Andriy Gelman <andriy.gelman at gmail.com>

---
 libavformat/mpegtsenc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index fc0ea225c6..1541a7a073 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -846,10 +846,8 @@ static int mpegts_init(AVFormatContext *s)
     ts->sdt.opaque       = s;
 
     pids = av_malloc_array(s->nb_streams, sizeof(*pids));
-    if (!pids) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
+    if (!pids) 
+        return AVERROR(ENOMEM);
 
     /* assign pids to each stream */
     for (i = 0; i < s->nb_streams; i++) {
-- 
2.22.0



More information about the ffmpeg-devel mailing list