From patchwork Fri Oct 26 10:40:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shenqichao X-Patchwork-Id: 10789 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 EC60A44C892 for ; Fri, 26 Oct 2018 13:56:53 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5C398689F89; Fri, 26 Oct 2018 13:56:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from m12-11.163.com (m12-11.163.com [220.181.12.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0FACE68066E for ; Fri, 26 Oct 2018 13:56:16 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=ioLjK awhwACJQr6e4V9FVIEC9fiuL6pTGDfBCs2pMUk=; b=d2egq52SLkgcsKzPBE9zo r2tc6A8B8qIOqxZGz+7a/rvXlMHnyEXavX4ai1W2bW2cqyWejSS0h4aZCGt++50b 7J1Dm4O6fJ4O5bfr94GpcVns48Y5z9TRtSrfm3jYpQz67ShgwmR/GbM2at0iW1SN 80zvf0VXWEbfiYDDYfz+h0= Received: from localhost.localdomain (unknown [116.236.177.50]) by smtp7 (Coremail) with SMTP id C8CowABXVFY979Jb6hC8Fg--.18787S3; Fri, 26 Oct 2018 18:41:21 +0800 (CST) From: shenqichao To: ffmpeg-devel@ffmpeg.org Date: Fri, 26 Oct 2018 18:40:53 +0800 Message-Id: <20181026104053.44219-1-qichaoshen@163.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 X-CM-TRANSID: C8CowABXVFY979Jb6hC8Fg--.18787S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrAFW8tFWxKFWrAw45Jw1UZFb_yoWxWFXE9F s7Gw1xZFWjvFW7Aa40krWxKrWfGayfZF4ftFn3trn7t3y8JFWY93WDWwn5W3WrJ343KryU Cr97tr12qr1SgjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUjAu4UUUUUU== X-Originating-IP: [116.236.177.50] X-CM-SenderInfo: xtlfxtprvkv0i6rwjhhfrp/xtbBygjrcVO+qv7ZwQAAs5 Subject: [FFmpeg-devel] [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 Cc: shenqichao Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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) ||