aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-29 03:34:17 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-10-29 03:34:17 +0100
commita3886ea3c5947ca05bfe01b053d9ce2f9725d9eb (patch)
tree1398aa63e2f0ae9075ca3816bb84042ac1d19c7b
parentb399816d9c3d0fc3efd742b04f269c1055cc6e2b (diff)
downloadffmpeg-a3886ea3c5947ca05bfe01b053d9ce2f9725d9eb.tar.gz
smoothstreamingenc: check return value of mkdir()
Fixes CID732188 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/smoothstreamingenc.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index 1f2a13f675..e51d088c48 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -287,7 +287,11 @@ static int ism_write_header(AVFormatContext *s)
int ret = 0, i;
AVOutputFormat *oformat;
- mkdir(s->filename, 0777);
+ if (mkdir(s->filename, 0777) < 0) {
+ av_log(s, AV_LOG_ERROR, "mkdir failed\n");
+ ret = AVERROR(errno);
+ goto fail;
+ }
oformat = av_guess_format("ismv", NULL, NULL);
if (!oformat) {
@@ -314,7 +318,11 @@ static int ism_write_header(AVFormatContext *s)
goto fail;
}
snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%d)", s->filename, s->streams[i]->codec->bit_rate);
- mkdir(os->dirname, 0777);
+ if (mkdir(os->dirname, 0777) < 0) {
+ ret = AVERROR(errno);
+ av_log(s, AV_LOG_ERROR, "mkdir failed\n");
+ goto fail;
+ }
ctx = avformat_alloc_context();
if (!ctx) {