On Sat, Oct 18, 2014 at 5:04 PM, Luca Barbato <[email protected]> wrote: > On 18/10/14 17:58, Vittorio Giovara wrote: >> >> From: Michael Niedermayer <[email protected]> >> >> CC: [email protected] >> Bug-Id: CID 1135748 >> --- >> libavformat/hdsenc.c | 15 ++++++++++++--- >> 1 file changed, 12 insertions(+), 3 deletions(-) >> >> diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c >> index 53fef33..f41381d 100644 >> --- a/libavformat/hdsenc.c >> +++ b/libavformat/hdsenc.c >> @@ -204,7 +204,10 @@ static int write_manifest(AVFormatContext *s, int >> final) >> avio_printf(out, "</manifest>\n"); >> avio_flush(out); >> avio_close(out); >> - rename(temp_filename, filename); >> + if (rename(temp_filename, filename) == -1) { >> + av_log(s, AV_LOG_ERROR, "failed to rename file %s to %s\n", >> temp_filename, filename); >> + return AVERROR(errno); > > > wrong, errno gets reset by av_log and you return 0;
Nice catch! Should errno be saved before the av_log, should we return ret directly or is there another way to fix this altogether? -- Vittorio _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
