Commit 1116491c authored by Michael Niedermayer's avatar Michael Niedermayer

matroska_parse_rm_audio: check for malloc failure

Fixes CID733712
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d7cabb3c
......@@ -2043,8 +2043,11 @@ static int matroska_parse_rm_audio(MatroskaDemuxContext *matroska,
}
while (track->audio.pkt_cnt) {
AVPacket *pkt = av_mallocz(sizeof(AVPacket));
av_new_packet(pkt, a);
AVPacket *pkt = NULL;
if (!(pkt = av_mallocz(sizeof(AVPacket))) || av_new_packet(pkt, a) < 0){
av_free(pkt);
return AVERROR(ENOMEM);
}
memcpy(pkt->data, track->audio.buf
+ a * (h*w / a - track->audio.pkt_cnt--), a);
pkt->pts = track->audio.buf_timecode;
......
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