]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/ccaption_dec: handle error from ass_sub api
authorAnshul Maheshwari <er.anshul.maheshwari@gmail.com>
Fri, 6 Feb 2015 14:42:13 +0000 (20:12 +0530)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 7 Feb 2015 04:51:17 +0000 (05:51 +0100)
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ccaption_dec.c

index d772cfc9bbc88e070a7e37190313a3dfac57afae..5e514b277f681d7818c06031e38ca6bdf147d2ae 100644 (file)
@@ -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;
 }