diff mbox

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

Message ID 20180628005117.18902-9-klaxa1337@googlemail.com
State New
Headers show

Commit Message

Stephan Holljes June 28, 2018, 12:51 a.m. UTC
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
---
 segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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