ismindex: check mkdir()s return code

Fixes CID733724
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-04-21 19:53:18 +02:00
parent bc7330a840
commit ebea370dc3
1 changed files with 2 additions and 1 deletions

View File

@ -132,7 +132,8 @@ static int write_fragments(struct Tracks *tracks, int start_index,
struct Track *track = tracks->tracks[i]; struct Track *track = tracks->tracks[i];
const char *type = track->is_video ? "video" : "audio"; const char *type = track->is_video ? "video" : "audio";
snprintf(dirname, sizeof(dirname), "QualityLevels(%d)", track->bitrate); snprintf(dirname, sizeof(dirname), "QualityLevels(%d)", track->bitrate);
mkdir(dirname, 0777); if (mkdir(dirname, 0777) == -1)
return AVERROR(errno);
for (j = 0; j < track->chunks; j++) { for (j = 0; j < track->chunks; j++) {
snprintf(filename, sizeof(filename), "%s/Fragments(%s=%"PRId64")", snprintf(filename, sizeof(filename), "%s/Fragments(%s=%"PRId64")",
dirname, type, track->offsets[j].time); dirname, type, track->offsets[j].time);