Commit 5f67073b authored by James Almer's avatar James Almer

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

Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 9924f1bc
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment