From 5647286e677839dd736c00d8f80514376c4cc9e3 Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari Date: Fri, 6 Feb 2015 20:12:13 +0530 Subject: [PATCH] avcodec/ccaption_dec: handle error from ass_sub api Signed-off-by: Anshul Maheshwari Signed-off-by: Michael Niedermayer --- libavcodec/ccaption_dec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index d772cfc9bbc..5e514b277f6 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; } -- 2.39.2