Commit 7ad359b3 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  xmv: do not leak memory in the error paths in xmv_read_header()
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 208be6b5 f8080bd1
...@@ -181,8 +181,10 @@ static int xmv_read_header(AVFormatContext *s) ...@@ -181,8 +181,10 @@ static int xmv_read_header(AVFormatContext *s)
avio_skip(pb, 2); /* Unknown (padding?) */ avio_skip(pb, 2); /* Unknown (padding?) */
xmv->audio = av_malloc(xmv->audio_track_count * sizeof(XMVAudioPacket)); xmv->audio = av_malloc(xmv->audio_track_count * sizeof(XMVAudioPacket));
if (!xmv->audio) if (!xmv->audio) {
return AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto fail;
}
for (audio_track = 0; audio_track < xmv->audio_track_count; audio_track++) { for (audio_track = 0; audio_track < xmv->audio_track_count; audio_track++) {
XMVAudioPacket *packet = &xmv->audio[audio_track]; XMVAudioPacket *packet = &xmv->audio[audio_track];
...@@ -221,8 +223,10 @@ static int xmv_read_header(AVFormatContext *s) ...@@ -221,8 +223,10 @@ static int xmv_read_header(AVFormatContext *s)
} }
ast = avformat_new_stream(s, NULL); ast = avformat_new_stream(s, NULL);
if (!ast) if (!ast) {
return AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto fail;
}
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id = packet->codec_id; ast->codec->codec_id = packet->codec_id;
......
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