diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-12 23:50:41 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-12 23:51:44 +0100 |
commit | b0112019f918b24b085395be243be91a196e73af (patch) | |
tree | c9dc68056cc0f42431d956a9df26c258c6974f76 /libavformat | |
parent | 9f8f2bcab6267be2054211dab9d5824af5517201 (diff) | |
parent | 6bdae41d3ef74a0865e8f87896e649f93b2f39bd (diff) | |
download | ffmpeg-b0112019f918b24b085395be243be91a196e73af.tar.gz |
Merge commit '6bdae41d3ef74a0865e8f87896e649f93b2f39bd'
* commit '6bdae41d3ef74a0865e8f87896e649f93b2f39bd':
matroskadec: Check memory allocations
Conflicts:
libavformat/matroskadec.c
See: 3e2a5b33f0355eeb80b6b2805be7f1b4fa1d1a46
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskadec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 6c0d0d5c15..cad207e228 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2648,8 +2648,11 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska, offset = 8; pkt = av_mallocz(sizeof(AVPacket)); - if (!pkt) + if (!pkt) { + if (pkt_data != data) + av_freep(&pkt_data); return AVERROR(ENOMEM); + } /* XXX: prevent data copy... */ if (av_new_packet(pkt, pkt_size + offset) < 0) { av_free(pkt); |