[SCM] libav/experimental: Add a goto for init failure instead of duplicate calls to ac3_encode_close().
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 17:20:30 UTC 2013
The following commit has been merged in the experimental branch:
commit 89bedc4d2e18d2b200aa80b59badbf8d158cdb4a
Author: Justin Ruggles <justin.ruggles at gmail.com>
Date: Thu Dec 16 03:44:32 2010 +0000
Add a goto for init failure instead of duplicate calls to ac3_encode_close().
Originally committed as revision 26030 to svn://svn.ffmpeg.org/ffmpeg/trunk
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 5649ec3..3240aee 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -1761,19 +1761,20 @@ static av_cold int ac3_encode_init(AVCodecContext *avctx)
s->mdct.avctx = avctx;
ret = mdct_init(&s->mdct, 9);
if (ret) {
- ac3_encode_close(avctx);
- return ret;
+ goto init_fail;
}
ret = allocate_buffers(avctx);
if (ret) {
- ac3_encode_close(avctx);
- return ret;
+ goto init_fail;
}
avctx->coded_frame= avcodec_alloc_frame();
return 0;
+init_fail:
+ ac3_encode_close(avctx);
+ return ret;
}
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list