[FFmpeg-devel,v2,1/2] avformat/dashenc: Handled the error from dashenc_io_open()

Submitted by kjeyapal@akamai.com on Nov. 28, 2018, 5:06 p.m.

Details

Message ID 20181128170617.97580-1-kjeyapal@akamai.com
State New
Headers show

Commit Message

kjeyapal@akamai.com Nov. 28, 2018, 5:06 p.m.
---
 libavformat/dashenc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 6ce70e0076..2f403257c0 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -527,8 +527,12 @@  static void output_segment_list(OutputStream *os, AVIOContext *out, AVFormatCont
         snprintf(temp_filename_hls, sizeof(temp_filename_hls), use_rename ? "%s.tmp" : "%s", filename_hls);
 
         set_http_options(&http_opts, c);
-        dashenc_io_open(s, &c->m3u8_out, temp_filename_hls, &http_opts);
+        ret = dashenc_io_open(s, &c->m3u8_out, temp_filename_hls, &http_opts);
         av_dict_free(&http_opts);
+        if (ret < 0) {
+            av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", temp_filename_hls);
+            return;
+        }
         for (i = start_index; i < os->nb_segments; i++) {
             Segment *seg = os->segments[i];
             double duration = (double) seg->duration / timescale;