Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-31 05:56:39 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-01-31 06:08:49 +0400
commitc89f8f80cc83622471eaf99e451e78df68475e19 (patch)
tree1ccd98aec9a06978d3f833b16098ec193045ff80 /libavformat/hdsenc.c
parent2e02d71237883fa9e876078b9a303fed435394c3 (diff)
avformat/hdsenc: check mkdir() return code
This also returns failure if the mkdir failure is not due to an already existing path. Fixed CID1135749 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/hdsenc.c')
-rw-r--r--libavformat/hdsenc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c
index f22875d0cc..fb0a94892a 100644
--- a/libavformat/hdsenc.c
+++ b/libavformat/hdsenc.c
@@ -329,7 +329,14 @@ static int hds_write_header(AVFormatContext *s)
int ret = 0, i;
AVOutputFormat *oformat;
- mkdir(s->filename, 0777);
+ if (mkdir(s->filename, 0777)) {
+ int is_error = errno != EEXIST;
+ av_log(s, is_error ? AV_LOG_ERROR : AV_LOG_VERBOSE, "Failed to create directory %s\n", s->filename);
+ if (is_error) {
+ ret = AVERROR(errno);
+ goto fail;
+ }
+ }
oformat = av_guess_format("flv", NULL, NULL);
if (!oformat) {