summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-12 23:50:41 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-12 23:51:44 +0100
commitb0112019f918b24b085395be243be91a196e73af (patch)
treec9dc68056cc0f42431d956a9df26c258c6974f76 /libavformat/matroskadec.c
parent9f8f2bcab6267be2054211dab9d5824af5517201 (diff)
parent6bdae41d3ef74a0865e8f87896e649f93b2f39bd (diff)
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/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c5
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);