aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-25 04:37:27 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-25 04:37:27 +0200
commit3ae818f6ab04f14838ee073e685d73519725f6d1 (patch)
treef316d7abcb908b1ae92759b860bacf4b51100683
parent45fd5935313bf29f5e09bab7ec49a98d73d9b9af (diff)
parente0caa1eb4e518111a81801db0d2ccdd2733ba94b (diff)
downloadffmpeg-3ae818f6ab04f14838ee073e685d73519725f6d1.tar.gz
Merge commit 'e0caa1eb4e518111a81801db0d2ccdd2733ba94b'
* commit 'e0caa1eb4e518111a81801db0d2ccdd2733ba94b': matroskadec: check return values Conflicts: libavformat/matroskadec.c See: 1116491c53156dd1972eca3e65d5a3b8529c4658 Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/matroskadec.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 2ef32223ec..e957117207 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2328,10 +2328,15 @@ static int matroska_parse_rm_audio(MatroskaDemuxContext *matroska,
}
while (track->audio.pkt_cnt) {
- AVPacket *pkt = NULL;
- if (!(pkt = av_mallocz(sizeof(AVPacket))) || av_new_packet(pkt, a) < 0) {
- av_free(pkt);
+ int ret;
+ AVPacket *pkt = av_mallocz(sizeof(AVPacket));
+ 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--),