projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c41ac4f
)
Add a goto for init failure instead of duplicate calls to ac3_encode_close().
author
Justin Ruggles
<justin.ruggles@gmail.com>
Thu, 16 Dec 2010 03:44:32 +0000
(
03:44
+0000)
committer
Justin Ruggles
<justin.ruggles@gmail.com>
Thu, 16 Dec 2010 03:44:32 +0000
(
03:44
+0000)
Originally committed as revision 26030 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavcodec/ac3enc.c
patch
|
blob
|
history
diff --git
a/libavcodec/ac3enc.c
b/libavcodec/ac3enc.c
index
5649ec3
..
3240aee
100644
(file)
--- 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;
}