diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2010-12-16 03:44:32 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2010-12-16 03:44:32 +0000 |
commit | 89bedc4d2e18d2b200aa80b59badbf8d158cdb4a (patch) | |
tree | ab266793b0dbf1930e1d74615643130996fe03cd /libavcodec | |
parent | c41ac4f82ed31b1dd83448c22b585509d56019f1 (diff) | |
download | ffmpeg-89bedc4d2e18d2b200aa80b59badbf8d158cdb4a.tar.gz |
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
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ac3enc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 5649ec3bac..3240aee53a 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; } |