Merge commit 'e0caa1eb4e518111a81801db0d2ccdd2733ba94b'

* commit 'e0caa1eb4e518111a81801db0d2ccdd2733ba94b':
  matroskadec: check return values

Conflicts:
	libavformat/matroskadec.c

See: 1116491c53
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-10-25 04:37:27 +02:00
commit 3ae818f6ab
1 changed files with 8 additions and 3 deletions

View File

@ -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--),