From: Vishwanath Dixit <vdi...@akamai.com>

Under error conditions, when the context is null, the application crashes
without this check.
---
 libavformat/hlsenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 1dd196f..334720f 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2318,7 +2318,8 @@ static int hls_write_packet(AVFormatContext *s, AVPacket 
*pkt)
     }
 
     vs->packets_written++;
-    ret = ff_write_chained(oc, stream_index, pkt, s, 0);
+    if (oc->pb)
+        ret = ff_write_chained(oc, stream_index, pkt, s, 0);
 
     return ret;
 }
-- 
1.9.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to