From patchwork Fri Sep 13 17:43:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vectronic X-Patchwork-Id: 15062 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 D8873447D6A for ; Fri, 13 Sep 2019 20:43:59 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BBA3A6881E5; Fri, 13 Sep 2019 20:43:59 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9BC8C68008A for ; Fri, 13 Sep 2019 20:43:53 +0300 (EEST) Received: by mail-wm1-f66.google.com with SMTP id x2so3625298wmj.2 for ; Fri, 13 Sep 2019 10:43:53 -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=06jju5X+WmuvFyqbzlKMHEfWXmZPlkZa3Et0kHSVS5Y=; b=nZavJKwn4ff/9HMuRihFAK0v3oxZhcitMYNiNFS04KDWzYUWcUFGnjH78OwO/r7Ufp rkWvholT7qSbZU277BHNnoDU8MCPRj2N4DqSeiEmJWto4mihDSCW+Bs+6zdWJqQnaCfH 3gBjkLivwVdpOIZ7Z+cCbGx67WxSv2YKAAOdXDwv4auXSiaHp6yY1c6pgGdK+qQ7ur1t UMUBm6pXsUd1va1dzZqbC1Orl7LyCluwrNgdq8Hu4eBDQpEsNktiG/hJpKAebBsV9xXN 2vD4YQdbU4yoRJYBUG9jB0MS/fjULfmZHWpNZWf+s1gs0XWDloL073Bhl0+ZJNPtdyI1 YMzQ== 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=06jju5X+WmuvFyqbzlKMHEfWXmZPlkZa3Et0kHSVS5Y=; b=Y05d5w42Jl08hCGKPF6zFjRt9CyLI7xKsIQtDzEFDyPTI4MrzYzzHImUPuqDSvMKIG iwWIVkU1b0pq4UAJK+4DZ55Zcx5OYmXZdydB5jMB5M0xT377fs40WycAPTtDSReKZt0c IDCKSjwVg3Uo7XxhAhVODEpuko2F/Xq3Isd4LTvPr6lA/w/UvZzyx6zx1Wphvuz4K01x QdnIgLdJSMhqkZiAVC0Chgwqw5Rsr9gSUj/0dOM694UPSDVKjOeBTrXJ5qwu7Q+8j4km bhE+s2DU4jyIe/8UwpBqSbJJ0SqfvOrsbDN4VbHV+X0VYWkzq3bLY1PtVxq4BQsdgniY IhVw== X-Gm-Message-State: APjAAAWF6kBrpm5Cex0I6Bse4URKzeQgyaHnus5zqHT/2UWRO7fKyxY/ u753A2BFXJY+OFawwggQKru87S91m6g= X-Google-Smtp-Source: APXvYqxkAAz/6MKpG5DMJebtbiX14/y5N+eGBxHcA20PDO3ZofGwRLU81C22U+NK6chjPRP9KlZ8/A== X-Received: by 2002:a05:600c:230d:: with SMTP id 13mr4631277wmo.114.1568396632991; Fri, 13 Sep 2019 10:43:52 -0700 (PDT) Received: from localhost.localdomain (78-32-249-178.static.enta.net. [78.32.249.178]) by smtp.gmail.com with ESMTPSA id a205sm5659405wmd.44.2019.09.13.10.43.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Sep 2019 10:43:52 -0700 (PDT) From: vectronic To: ffmpeg-devel@ffmpeg.org Date: Fri, 13 Sep 2019 18:43:32 +0100 Message-Id: <20190913174332.94299-1-hello.vectronic@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/dashdec: fix range parsing causing issues with http byte range requests 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: vectronic Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" data size calculation was off by one as per DASH SPEC which references RFC 7233. this was then used in http byte range request causing data corruption when parsing media files referenced in manifest fixes: 8136 Signed-off-by: vectronic --- libavformat/dashdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 74eb900eea..aa0e3598a1 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -600,7 +600,7 @@ static struct fragment * get_Fragment(char *range) char *str_end_offset; char *str_offset = av_strtok(range, "-", &str_end_offset); seg->url_offset = strtoll(str_offset, NULL, 10); - seg->size = strtoll(str_end_offset, NULL, 10) - seg->url_offset; + seg->size = strtoll(str_end_offset, NULL, 10) - seg->url_offset + 1; } return seg;