From 0250fc2146b36ace8b8db904b884f70c9393b105 Mon Sep 17 00:00:00 2001 From: Marton Balint Date: Thu, 11 Feb 2016 01:37:37 +0100 Subject: [PATCH] avformat/img2enc: return error if image rename fails Signed-off-by: Marton Balint --- libavformat/img2enc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c index a118e73ab2..280d598047 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; } }