avformat/matroskaenc: add missing allocation failure checks for stream durations

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2017-11-28 01:23:23 -03:00
parent 9924f1bc34
commit 5f67073b4c
1 changed files with 4 additions and 0 deletions

View File

@ -1965,6 +1965,10 @@ static int mkv_write_header(AVFormatContext *s)
// initialize stream_duration fields
mkv->stream_durations = av_mallocz(s->nb_streams * sizeof(int64_t));
mkv->stream_duration_offsets = av_mallocz(s->nb_streams * sizeof(int64_t));
if (!mkv->stream_durations || !mkv->stream_duration_offsets) {
ret = AVERROR(ENOMEM);
goto fail;
}
ret = mkv_write_tracks(s);
if (ret < 0)