From patchwork Fri Oct 26 15:03:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shenqichao X-Patchwork-Id: 10790 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 B24B244CA8B for ; Fri, 26 Oct 2018 18:05:14 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2316A68A0F6; Fri, 26 Oct 2018 18:04:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from m13-79.163.com (m13-79.163.com [220.181.13.79]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3C895689F6D for ; Fri, 26 Oct 2018 18:04:06 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:MIME-Version:Message-ID; bh=Kgm7M sx/pf1/6vgq8lsFGhlR4yRPAfYrAHpWPIRQ1Wc=; b=Mr/d+69uTh4h41PDondmy UI/J6crmh3eW4pfIHkGNnnIacgC75TxSKNdzRzCUdtyFkX+kxI5crBdbpCj471Y6 JcvYtP3sh/ksRte7k3E0Y9ajDlfJRz+0VbDjxbdy0FvhZgbTtS6KRcdZSYQjAlvo mQCmGBMsxuWdHNJSn1eeOY= Received: from qichaoshen$163.com ( [116.236.177.50] ) by ajax-webmail-wmsvr79 (Coremail) ; Fri, 26 Oct 2018 23:03:58 +0800 (CST) X-Originating-IP: [116.236.177.50] Date: Fri, 26 Oct 2018 23:03:58 +0800 (CST) From: =?GBK?B?yfLG9LOs?= To: ffmpeg-devel@ffmpeg.org X-Priority: 3 X-Mailer: Coremail Webmail Server Version SP_ntes V3.5 build 20160729(86883.8884) Copyright (c) 2002-2018 www.mailtech.cn 163com X-CM-CTRLDATA: +j4sC2Zvb3Rlcl9odG09MTQwODo1Ng== MIME-Version: 1.0 Message-ID: <35e4c75a.10e13.166b0e74420.Coremail.qichaoshen@163.com> X-Coremail-Locale: zh_CN X-CM-TRANSID: T8GowADXV6HeLNNb3caYAA--.17931W X-CM-SenderInfo: xtlfxtprvkv0i6rwjhhfrp/1tbiGRDrcVXlgmERKQABs5 X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] Fw: [PATCH] add the protection for http range get request starting from file size 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" I add the comment about the issue "https://trac.ffmpeg.org/ticket/6885" -------- Forwarding messages -------- From: "shenqichao" Date: 2018-10-26 18:40:53 To: ffmpeg-devel@ffmpeg.org Cc: shenqichao Subject: [FFmpeg-devel] [PATCH] add the protection for http range get request starting from file size Signed-off-by: shenqichao --- libavformat/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/http.c b/libavformat/http.c index 3a35bc7eac..129f683d15 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -1669,7 +1669,7 @@ static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int fo int old_buf_size, ret; AVDictionary *options = NULL; - if (whence == AVSEEK_SIZE) + if (whence == AVSEEK_SIZE || (whence == SEEK_SET && off == s->filesize)) return s->filesize; else if (!force_reconnect && ((whence == SEEK_CUR && off == 0) ||