avformat/hlsenc: Check the return code of avformat_write_header()
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 13 Dec 2015 01:28:13 +0000 (02:28 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 13 Dec 2015 01:28:13 +0000 (02:28 +0100)
Fixes: segfault
Fixes: Ticket5067

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/hlsenc.c

index 3181cc7..adcf7df 100644 (file)
@@ -571,8 +571,11 @@ static int hls_start(AVFormatContext *s)
         av_opt_set(oc->priv_data, "pat_period", period, 0);
     }
 
-    if (c->vtt_basename)
-        avformat_write_header(vtt_oc,NULL);
+    if (c->vtt_basename) {
+        err = avformat_write_header(vtt_oc,NULL);
+        if (err < 0)
+            return err;
+    }
 
     return 0;
 fail: