From patchwork Thu Sep 6 18:58:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 10261 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp797941jap; Thu, 6 Sep 2018 11:58:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbpxwplMgK5rcgp31Xn/2Gpp2tQ0bAC9oyvMqcGFyxLUvFnis41jNajhkzh6bXYp4RWTwIS X-Received: by 2002:adf:a4d1:: with SMTP id h17-v6mr3255007wrb.167.1536260331338; Thu, 06 Sep 2018 11:58:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536260331; cv=none; d=google.com; s=arc-20160816; b=vsPiqgj/scN7gsEmNbnb2RDL5Wu1avKaszprO4RVo1Kb2g+8jd/0533HksGYVDl2Vh qBF8xRqe+/8AXBxh7Yf5KfqLS8pC7oPYsmLlENeRtDpNZ8BfEAMQ6P1TwwGJ6HPructM Fcm/gRe5OQvfifFfVdIM/CEu9njqSQYHG+TPK5EG2+KB/AR44a5izcZZ636WH+TySye3 kX3CdXHAsUE5vw5lE6vfzqiXl+63CGctOYV0eK2KU8hi3Z8RHX9uiFHO/0K0jwtsTCnF tbyYvJdoTQIbw4Wh5zKEqU0ycYlaz/AlRtEdGkPZNConIqr5ntz49Hp9itHKUPGcZwnz uwyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=YVkP3LjVv5oDGWkBwv/yunySf4yvF5sBi0K28fJv7og=; b=cXGi/AcXawDJ4SC1QVYeDw4HPg2TbsijhxaLPYbP2wqbH1aro+mm8YCFtvmRyWtMmh 9QhCol+HghdY9A/78PQDgzxcUGPZVztZtOehWG1ztEUXZ7FhZERRzX4pELv1qninofL2 ypX1qcnJOLTV4OE6D9JiH37p08fBLkSOFYycTVCxv1Es85s7eMEC3K3EqfSJ0jpD4li9 jsXIPkXcnTvqAmv2cPWxTjWFYpCrjnxBBJqL38Pp715Uvxy8cKm8YXiJ7ky6AxqzrYcy dt6tPu758x89neHRInveIPq2Nx8LQzZYXUqtbl1jNfiQgfzvYuYGg6voN6cviHN+VckA JjMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n67-v6si4508922wmf.112.2018.09.06.11.58.51; Thu, 06 Sep 2018 11:58:51 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5227568A0A6; Thu, 6 Sep 2018 21:58:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5AE0F689FF0 for ; Thu, 6 Sep 2018 21:58:35 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id E5FE8E127E; Thu, 6 Sep 2018 20:58:42 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5AFPcNzqWHUC; Thu, 6 Sep 2018 20:58:42 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 0215BE0F69; Thu, 6 Sep 2018 20:58:41 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 6 Sep 2018 20:58:36 +0200 Message-Id: <20180906185837.24645-1-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 Subject: [FFmpeg-devel] [PATCH 1/2] avutil/file: do not request PROT_WRITE in av_file_map 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: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The documentation states that av_file_map can only be used for reading and for WIN32 we are already requesting a read only mapping. Signed-off-by: Marton Balint --- libavutil/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/file.c b/libavutil/file.c index 24a86c3f35..2153e51379 100644 --- a/libavutil/file.c +++ b/libavutil/file.c @@ -86,7 +86,7 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, *size = off_size; #if HAVE_MMAP - ptr = mmap(NULL, *size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); + ptr = mmap(NULL, *size, PROT_READ, MAP_PRIVATE, fd, 0); if (ptr == MAP_FAILED) { err = AVERROR(errno); av_strerror(err, errbuf, sizeof(errbuf));