Merge commit '6bdae41d3ef74a0865e8f87896e649f93b2f39bd'

* commit '6bdae41d3ef74a0865e8f87896e649f93b2f39bd':
  matroskadec: Check memory allocations

Conflicts:
	libavformat/matroskadec.c

See: 3e2a5b33f0
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-03-12 23:50:41 +01:00
commit b0112019f9
1 changed files with 4 additions and 1 deletions

View File

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