From patchwork Sat May 6 00:10:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 3585 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.3.129 with SMTP id 123csp471099vsd; Fri, 5 May 2017 17:11:04 -0700 (PDT) X-Received: by 10.223.178.236 with SMTP id g99mr31115728wrd.126.1494029464728; Fri, 05 May 2017 17:11:04 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 18si8074488wry.114.2017.05.05.17.11.04; Fri, 05 May 2017 17:11:04 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7298F689A28; Sat, 6 May 2017 03:10:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-3.mx.upcmail.net (vie01a-dmta-pe03-3.mx.upcmail.net [62.179.121.162]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BD5A76899EB for ; Sat, 6 May 2017 03:10:50 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1d6nJH-0000rb-Ek for ffmpeg-devel@ffmpeg.org; Sat, 06 May 2017 02:10:55 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id GoAs1v00Q0S5wYM01oAtzH; Sat, 06 May 2017 02:10:53 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 6 May 2017 02:10:48 +0200 Message-Id: <20170506001050.23234-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170506001050.23234-1-michael@niedermayer.cc> References: <20170506001050.23234-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/4] avcodec/samidec: Check ff_htmlmarkup_to_ass() return code X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavcodec/samidec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c index 16f3f58c1c..2620424750 100644 --- a/libavcodec/samidec.c +++ b/libavcodec/samidec.c @@ -113,10 +113,14 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src) av_bprint_clear(&sami->full); if (sami->source.len) { - ff_htmlmarkup_to_ass(avctx, dst_source, sami->source.str); + ret = ff_htmlmarkup_to_ass(avctx, dst_source, sami->source.str); + if (ret < 0) + goto end; av_bprintf(&sami->full, "{\\i1}%s{\\i0}\\N", sami->encoded_source.str); } - ff_htmlmarkup_to_ass(avctx, dst_content, sami->content.str); + ret = ff_htmlmarkup_to_ass(avctx, dst_content, sami->content.str); + if (ret < 0) + goto end; av_bprintf(&sami->full, "%s", sami->encoded_content.str); end: