aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-04 14:30:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-04 14:35:40 +0200
commit7ad359b3949cc333697f722c050ff4d4a73276ae (patch)
tree40acd7d5c82c19a3f292369fc676aaf5d28a7092 /libavformat
parent208be6b54a91b7da699497d0bb361dbf542d6518 (diff)
parentf8080bd13b5f7fc48204b17fa59a5ce9feb15f07 (diff)
downloadffmpeg-7ad359b3949cc333697f722c050ff4d4a73276ae.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: xmv: do not leak memory in the error paths in xmv_read_header() Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/xmv.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libavformat/xmv.c b/libavformat/xmv.c
index df950e5262..672b6d998f 100644
--- a/libavformat/xmv.c
+++ b/libavformat/xmv.c
@@ -181,8 +181,10 @@ static int xmv_read_header(AVFormatContext *s)
avio_skip(pb, 2); /* Unknown (padding?) */
xmv->audio = av_malloc(xmv->audio_track_count * sizeof(XMVAudioPacket));
- if (!xmv->audio)
- return AVERROR(ENOMEM);
+ if (!xmv->audio) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
for (audio_track = 0; audio_track < xmv->audio_track_count; audio_track++) {
XMVAudioPacket *packet = &xmv->audio[audio_track];
@@ -221,8 +223,10 @@ static int xmv_read_header(AVFormatContext *s)
}
ast = avformat_new_stream(s, NULL);
- if (!ast)
- return AVERROR(ENOMEM);
+ if (!ast) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id = packet->codec_id;