[FFmpeg-cvslog] avformat/matroskadec: Check av_mallocz() return values

Michael Niedermayer git at videolan.org
Sun Jan 25 00:35:50 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 25 00:25:01 2015 +0100| [c1cdce5dcb957f6bde0c08905190d905993b61eb] | committer: Michael Niedermayer

avformat/matroskadec: Check av_mallocz() return values

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c1cdce5dcb957f6bde0c08905190d905993b61eb
---

 libavformat/matroskadec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 95ec67c..2645797 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2507,6 +2507,8 @@ static int matroska_parse_webvtt(MatroskaDemuxContext *matroska,
         return AVERROR_INVALIDDATA;
 
     pkt = av_mallocz(sizeof(*pkt));
+    if (!pkt)
+        return AVERROR(ENOMEM);
     err = av_new_packet(pkt, text_len);
     if (err < 0) {
         av_free(pkt);
@@ -2592,6 +2594,8 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
         offset = 8;
 
     pkt = av_mallocz(sizeof(AVPacket));
+    if (!pkt)
+        return AVERROR(ENOMEM);
     /* XXX: prevent data copy... */
     if (av_new_packet(pkt, pkt_size + offset) < 0) {
         av_free(pkt);



More information about the ffmpeg-cvslog mailing list