[FFmpeg-cvslog] avformat/matroskaenc: add missing allocation failure checks for stream durations
James Almer
git at videolan.org
Tue Nov 28 06:25:04 EET 2017
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Nov 28 01:23:23 2017 -0300| [5f67073b4cb12abf21ed840948b271903d61bf3b] | committer: James Almer
avformat/matroskaenc: add missing allocation failure checks for stream durations
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5f67073b4cb12abf21ed840948b271903d61bf3b
---
libavformat/matroskaenc.c | 4 ++++
1 file changed, 4 insertions(+)
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)
More information about the ffmpeg-cvslog
mailing list