[FFmpeg-devel] [PATCH 1/2] avformat/img2enc: return error if image rename fails

Marton Balint cus at passwd.hu
Thu Feb 11 02:23:10 CET 2016


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavformat/img2enc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index a118e73..280d598 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -180,7 +180,9 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
     if (!img->is_pipe) {
         ff_format_io_close(s, &pb[0]);
         for (i = 0; i < nb_renames; i++) {
-            ff_rename(img->tmp[i], img->target[i], s);
+            int ret = ff_rename(img->tmp[i], img->target[i], s);
+            if (ret < 0)
+                return ret;
         }
     }
 
-- 
2.6.2



More information about the ffmpeg-devel mailing list