aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-10-24 00:05:53 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-10-24 23:48:51 +0100
commite0caa1eb4e518111a81801db0d2ccdd2733ba94b (patch)
tree41622f36af00eb0c0bb11697e07174bb8ee01a5a
parent3c1199c3c4cbdb4ffff0de89f06d5a08acefe356 (diff)
downloadffmpeg-e0caa1eb4e518111a81801db0d2ccdd2733ba94b.tar.gz
matroskadec: check return values
CC: libav-stable@libav.org Bug-Id: CID 733712
-rw-r--r--libavformat/matroskadec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index d3ce009ac0..a83589a4a0 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2132,8 +2132,16 @@ static int matroska_parse_rm_audio(MatroskaDemuxContext *matroska,
}
while (track->audio.pkt_cnt) {
+ int ret;
AVPacket *pkt = av_mallocz(sizeof(AVPacket));
- av_new_packet(pkt, a);
+ if (!pkt)
+ return AVERROR(ENOMEM);
+
+ ret = av_new_packet(pkt, a);
+ if (ret < 0) {
+ av_free(pkt);
+ return ret;
+ }
memcpy(pkt->data,
track->audio.buf + a * (h * w / a - track->audio.pkt_cnt--),
a);