[FFmpeg-devel] [PATCH 08/17] segment.c: set *seg_p to NULL earlier so it is NULL for every error condition.

Stephan Holljes klaxa1337 at googlemail.com
Thu Jun 28 03:51:08 EEST 2018


Signed-off-by: Stephan Holljes <klaxa1337 at googlemail.com>
---
 segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/segment.c b/segment.c
index 8b76510..9ec144f 100644
--- a/segment.c
+++ b/segment.c
@@ -114,9 +114,9 @@ void segment_init(struct Segment **seg_p, AVFormatContext *fmt)
     int i;
     AVStream *in_stream, *out_stream;
     struct Segment *seg = av_malloc(sizeof(struct Segment));
+    *seg_p = NULL;
     if (!seg) {
         av_log(fmt, AV_LOG_ERROR, "Could not allocate segment.\n");
-        *seg_p = NULL;
         return;
     }
 
-- 
2.18.0



More information about the ffmpeg-devel mailing list