mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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
This commit is contained in:
parent
c41ac4f82e
commit
89bedc4d2e
@ -1761,19 +1761,20 @@ static av_cold int ac3_encode_init(AVCodecContext *avctx)
|
|||||||
s->mdct.avctx = avctx;
|
s->mdct.avctx = avctx;
|
||||||
ret = mdct_init(&s->mdct, 9);
|
ret = mdct_init(&s->mdct, 9);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ac3_encode_close(avctx);
|
goto init_fail;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = allocate_buffers(avctx);
|
ret = allocate_buffers(avctx);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ac3_encode_close(avctx);
|
goto init_fail;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
avctx->coded_frame= avcodec_alloc_frame();
|
avctx->coded_frame= avcodec_alloc_frame();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
init_fail:
|
||||||
|
ac3_encode_close(avctx);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user