Commit b0112019 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '6bdae41d'

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

Conflicts:
	libavformat/matroskadec.c

See: 3e2a5b33Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 9f8f2bca 6bdae41d
...@@ -2648,8 +2648,11 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska, ...@@ -2648,8 +2648,11 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
offset = 8; offset = 8;
pkt = av_mallocz(sizeof(AVPacket)); pkt = av_mallocz(sizeof(AVPacket));
if (!pkt) if (!pkt) {
if (pkt_data != data)
av_freep(&pkt_data);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
}
/* XXX: prevent data copy... */ /* XXX: prevent data copy... */
if (av_new_packet(pkt, pkt_size + offset) < 0) { if (av_new_packet(pkt, pkt_size + offset) < 0) {
av_free(pkt); av_free(pkt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment