[FFmpeg-devel,3/3] avformat/dashenc: add avpriv_io_move return value check

Submitted by Steven Liu on Dec. 2, 2017, 2:44 a.m.

Details

Message ID 20171202024402.7745-1-lq@chinaffmpeg.org
State New
Headers show

Commit Message

Steven Liu Dec. 2, 2017, 2:44 a.m.
fix cid: 1424883

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/dashenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Moritz Barsnick Dec. 2, 2017, 2:42 p.m.
On Sat, Dec 02, 2017 at 10:44:02 +0800, Steven Liu wrote:
> +                av_log(os->ctx, AV_LOG_WARNING, "rename file from %s to %s faild\n", temp_filename_hls, filename_hls);
                                                    ^ renaming                ^ failed

Perhaps just "renaming file %s to %s failed\n".

Moritz
Steven Liu Dec. 4, 2017, 9:48 a.m.
2017-12-02 22:42 GMT+08:00 Moritz Barsnick <barsnick@gmx.net>:
> On Sat, Dec 02, 2017 at 10:44:02 +0800, Steven Liu wrote:
>> +                av_log(os->ctx, AV_LOG_WARNING, "rename file from %s to %s faild\n", temp_filename_hls, filename_hls);
>                                                     ^ renaming                ^ failed
>
> Perhaps just "renaming file %s to %s failed\n".

fixed it localy, and pushed


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

Patch hide | download patch | download mbox

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 22ef3103dc..bd0a98da4d 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -384,7 +384,9 @@  static void output_segment_list(OutputStream *os, AVIOContext *out, DASHContext
 
         avio_close(out_hls);
         if (use_rename)
-            avpriv_io_move(temp_filename_hls, filename_hls);
+            if (avpriv_io_move(temp_filename_hls, filename_hls) < 0) {
+                av_log(os->ctx, AV_LOG_WARNING, "rename file from %s to %s faild\n", temp_filename_hls, filename_hls);
+            }
     }
 
 }