From patchwork Thu Jun 8 21:53:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 3873 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp3060350vsk; Thu, 8 Jun 2017 14:54:12 -0700 (PDT) X-Received: by 10.223.151.107 with SMTP id r98mr26931331wrb.6.1496958852063; Thu, 08 Jun 2017 14:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496958852; cv=none; d=google.com; s=arc-20160816; b=xOVx/6FK5wARY2XOT/CpfIN4sAXa6pKFBavo+FcJtyT8jkz/I+yTB3bOfHCqAI1j8G w2yjEp/cQc1/+HLkx6zpTSn7v8LPeFGAjsKG67Jw8jGxl4TMVAR/M5WunoPdqXFLrm3s ywK8lBsyc0hA1TjhKzsMMuukGkffV+jDYw0fY0pGX69+q2hfOhOxSQoiP0gvETsEmSx6 6Qj/xw8rkKNDMuh0on2eoX5lxEAKgpWQDZhPeEXA8UhhiYnzcHEkHfIiafBG7HIFEu0P a42vcwv2KEc4xwOKlDTcZnNyGUtBdzoGot1uuU8LA792jgFCkRlmCRZoESiYzSUGrsOe IaUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=C8/h4DSvAr6Dxcc9oSqwdb00+g29/OAqpgUBfR0xO3Y=; b=Ffzq2U6w9sYZsCyK0pUODeazHeSM0DXmLPrfv1uEvv/nE/XKi8J54fIfo3Vznsjoje BTyKfemQOyY8ZS1f8vWO0v72n2q/pEGgAxCU8/i36JQLZrTXbD1yqj+7CTc6IHSF9CgI xYPA2az9/8bWtoGrefOIZKjXf2D3FHPn1WCzD2Xd5+YhTXvBN4hEuIigC57jqcj5c3uG Oi8uMTZSHyfN8dMULb6x1asjXhupnVg4NTG69PI2Ucgaocanba8Ppw87S+681n5GEEmb mnppKrsbLOJ5QY89KHIB+om49S/NtV9qHFkrUL3qufF6AFKpyRSJrl1sMKOChZdkk/Y0 yRxw== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h77si6869531wmd.111.2017.06.08.14.54.11; Thu, 08 Jun 2017 14:54:12 -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 E19DE689C13; Fri, 9 Jun 2017 00:54:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-1.mx.upcmail.net (vie01a-qmta-pe02-1.mx.upcmail.net [62.179.121.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 08319680BE4 for ; Fri, 9 Jun 2017 00:54:06 +0300 (EEST) Received: from [172.31.218.43] (helo=vie01a-dmta-pe05-1.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dJ5NW-0006np-AL for ffmpeg-devel@ffmpeg.org; Thu, 08 Jun 2017 23:54:06 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dJ5NQ-0006pl-8H for ffmpeg-devel@ffmpeg.org; Thu, 08 Jun 2017 23:54:00 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id WMty1v00Z0S5wYM01Mtzv8; Thu, 08 Jun 2017 23:53:59 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 8 Jun 2017 23:53:56 +0200 Message-Id: <20170608215356.23864-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170608215356.23864-1-michael@niedermayer.cc> References: <20170608215356.23864-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/htmlsubtitles: use next_closep instead of the identical value from sscanf() 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" This makes the code easier to understand and allows future changes simplifying some of the scanf() away Signed-off-by: Michael Niedermayer --- libavcodec/htmlsubtitles.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/htmlsubtitles.c b/libavcodec/htmlsubtitles.c index ba4f269b3f..602fff9e2d 100644 --- a/libavcodec/htmlsubtitles.c +++ b/libavcodec/htmlsubtitles.c @@ -93,7 +93,7 @@ int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in) if (*next_closep == '}' && (an != 1 && (len = 0, sscanf(in, "{\\%*[^}]}%n", &len) >= 0 && len > 0)) || *next_closep == '}' && (len = 0, sscanf(in, "{%*1[CcFfoPSsYy]:%*[^}]}%n", &len) >= 0 && len > 0)) { - in += len - 1; + in = next_closep; } else av_bprint_chars(dst, *in, 1); break;