diff options
author | James Almer <jamrial@gmail.com> | 2017-11-28 01:23:23 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-11-28 01:23:23 -0300 |
commit | 5f67073b4cb12abf21ed840948b271903d61bf3b (patch) | |
tree | 2381dbc2c8925f991e24fbb6a0f572dfaa2ef211 /libavformat | |
parent | 9924f1bc34242bb9315c355108f3ce744c1f33c5 (diff) | |
download | ffmpeg-5f67073b4cb12abf21ed840948b271903d61bf3b.tar.gz |
avformat/matroskaenc: add missing allocation failure checks for stream durations
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskaenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 35857bb02e..f22c2ab70c 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -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) |