From patchwork Sat Jun 20 09:27:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 20519 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id AB8704499AC for ; Sat, 20 Jun 2020 12:27:15 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8013768B666; Sat, 20 Jun 2020 12:27:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 76E2D68B510 for ; Sat, 20 Jun 2020 12:27:08 +0300 (EEST) Received: by mail-wr1-f68.google.com with SMTP id l10so11879458wrr.10 for ; Sat, 20 Jun 2020 02:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KP3yp6HT0a/JK5pTRIYTrba1gf2AHUHYpNw6P3/egd0=; b=cs9O+0UsnS9J6YzByg/CK8NIRlYNTNjZa2FF/EL40B1LkDNkErVIFmU93WN+K7aJ61 Qleg2dAgeyQqzWz8S+z5Jy9c5f1N9itEIpV1VoRce7ij5We6q/VUJCnhrJ9AJXYPQ1Od GoHOlwNfmrixi7fiqD3BWqcvirfpU2FNEJy4uBWdAw/zDXeij8/Fj79cakQu5aW8fXiy WAuipL1RBvUDtyXvSz+XnOlvtd/lBIrlrT7SAeXqtY+mrKSaC/UhCssmzIOSBVnO6LMU S5aVCeNiZ4RP7h6X/Y8u0KqDK5Dqtqlh9URLBBk87yog+mnGiZgBRygbUOiT3O9gnUSs Teww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KP3yp6HT0a/JK5pTRIYTrba1gf2AHUHYpNw6P3/egd0=; b=TZ/1aUSzO268tImbaGbCDKYpPz6slhKYDIRiZlUmUwETYycQakpXj9Z94outYWAT8D /38yGjWBfIv28CPEO2DP3nxcIRcqSPPUWVgWTDdAm7j/XnLuH8GFUaZjVkmHyZhVqrIk EEYVrhDShV8OXCb7O9pYHfmry+UA8hH8+s4iZRVeKJ/98Ow+HG0HSzOzkOe5EIVgl8+e vA3GyI+3Ic/iDMn/bWhwQU7FL2f/fxBx0VSOCNKSyXBeDcW2/AoFqbjptdtLihrJOWJB Ijrhr8Jptt55b7RBy6K0gssMbCp2/pXH7/AD8HZo0xtlqWizdm4b35os3uVO03qXVZlz QmUA== X-Gm-Message-State: AOAM531RuuJ3lc0hc8VvI0wUbrIGoYasxpRZaJwOZA0rfh6C1Ue7p3C9 yh8MMH73M1kS24r+9gNp77xd9j+n X-Google-Smtp-Source: ABdhPJxXFmXqMSzX50H2Hu1Bs7nklxT8mpzTOg+qpgXLoKuwpjMyYu+d6FaFnbo9hyJEcVVusxPC9g== X-Received: by 2002:adf:e90b:: with SMTP id f11mr8314745wrm.248.1592645227601; Sat, 20 Jun 2020 02:27:07 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id n16sm4184957wrq.39.2020.06.20.02.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jun 2020 02:27:07 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 20 Jun 2020 11:27:00 +0200 Message-Id: <20200620092700.21924-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/webvttdec: Accept \r as newline 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" After parsing the end timestamp of a WebVTT cue block, the current code skips everything after the start of the timestamp that is not a \t, ' ' or \n and treats what is next as the start of a WebVTT cue settings list. Yet if there is no such list, but a single \r, this will skip a part of the cue payload (namely everything until the first occurence of \t, ' ' or \n) and treat what has not been skipped as the beginning of the WebVTT cue settings list that extends until the next \r or \n (or the end). Signed-off-by: Andreas Rheinhardt --- libavformat/webvttdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c index bd3d45b382..8d2fdfed37 100644 --- a/libavformat/webvttdec.c +++ b/libavformat/webvttdec.c @@ -125,7 +125,7 @@ static int webvtt_read_header(AVFormatContext *s) break; /* optional cue settings */ - p += strcspn(p, "\n\t "); + p += strcspn(p, "\n\r\t "); while (*p == '\t' || *p == ' ') p++; settings = p;