diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index d772cfc9bb..5e514b277f 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -181,13 +181,16 @@ static av_cold int init_decoder(AVCodecContext *avctx) ctx->mode = CCMODE_ROLLUP_2; ctx->rollup = 2; ret = ff_ass_subtitle_header_default(avctx); + if(ret < 0) { + goto fail; + } /* allocate pkt buffer */ ctx->pktbuf = av_buffer_alloc(128); if( !ctx->pktbuf) { ret = AVERROR(ENOMEM); } - +fail: return ret; }