From patchwork Mon Oct 29 09:42:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shenqichao X-Patchwork-Id: 10836 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 6C15544D8F7 for ; Mon, 29 Oct 2018 11:58:20 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D100F689EE8; Mon, 29 Oct 2018 11:57:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from m12-14.163.com (m12-14.163.com [220.181.12.14]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 30D66689ECC for ; Mon, 29 Oct 2018 11:57:43 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=HQ7lm 4VjrYXPLaditzPLIrw0nTf+Pd+cQtJSqfRc2n8=; b=gFTkQ1UHTGu4VNHA9T04M H8XMQgM7Y/Cbj/wxn1Kr12LDcverGCMG14j7VQv+B0iAhQf0wugwgv4oX/AFcV7o SbBYFolkyUVUmy+J0TObMN0MjgVkMI5nzRkN30Lh7TuidqDbdqT2Am48wIx375sc uNOob07Wq34lrpXTAujZXU= Received: from localhost.localdomain (unknown [116.236.177.50]) by smtp10 (Coremail) with SMTP id DsCowACHm7Ek1tZbwevrWQ--.31267S3; Mon, 29 Oct 2018 17:43:01 +0800 (CST) From: shenqichao To: ffmpeg-devel@ffmpeg.org Date: Mon, 29 Oct 2018 17:42:51 +0800 Message-Id: <20181029094251.45226-1-qichaoshen@163.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 X-CM-TRANSID: DsCowACHm7Ek1tZbwevrWQ--.31267S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrtFW3KFykur4UAF1xCrWktFb_yoWxCFgE9F 4xGw1xZFWjvFW7Jw10krW8KrWxJayfZFs3JFn3trn2y3y8JrZ093WDWr1kX3WrJw43Kry5 Ar97tr12qr1SgjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU17Ks5UUUUU== X-Originating-IP: [116.236.177.50] X-CM-SenderInfo: xtlfxtprvkv0i6rwjhhfrp/1tbiNQXucVrPM+DTxgAAs8 Subject: [FFmpeg-devel] [PATCH] libavformat/http.c: add the protection about the http seek implement if a http resource is not streamed, it can seek to the end of this resouce.I add the detail information at https://trac.ffmpeg.org/ticket/6885 Fixes ticket #6885. 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..9401a5c63e 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 || (h->is_streamed == 0 && whence == SEEK_SET && off == s->filesize)) return s->filesize; else if (!force_reconnect && ((whence == SEEK_CUR && off == 0) ||