From patchwork Fri Oct 27 16:49:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 5720 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp922066jah; Fri, 27 Oct 2017 09:50:43 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RVvkgJe7qlcZR2e9iUAKfbBK7NobBsPcKK2Kv82HxnOzBR0xdzLW+pDlx11UCiMimPRYVr X-Received: by 10.28.194.6 with SMTP id s6mr880072wmf.14.1509123043741; Fri, 27 Oct 2017 09:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509123043; cv=none; d=google.com; s=arc-20160816; b=D7+5Mw0qQflkrlFUId+TfLo+sBhGonCWoZ/eP6qAg+6zedkepohNqev2+9PMXLaA60 4JKkhMrvoZFfA4Y8UDf4xc2ysXL5SRJnAcV7WK2A2HoMuhLQmQ/VpWUSzno6NRj4djqX wPxnB1+Xy8t7nXfagivWNWpTbDD4fmhNyOC1AdsMXr0DcPF0CStMtWrQ0A1CWiweCbPz GtPJ3M/iB0m1LLgx6kXyctB1P2SotkxdAysZRKbu/YzdFO1rnwqJZc2EQGlWVSdll/tq /N8W/QdyuttBaolo8vsaJd5IBH+9siYWp2AMdDF9e0p4jR3enD1/zZQ91rFoK1xiaVed dZiA== 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:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=lTMVixRA6f8LX2sZ919IL/MOjDU0F5RVZtJbiCI7pvc=; b=f0uh95SEp2e564/oGZlCPzWyBSgvg4EeP3vzXm65k0a8LubQefdYWY5dOkNfWxLPAI uW7grcY88i1fbmz5mGNk/CkJdTHDabi4M+JWSBWWvFLMNLwWlZFoSqoobhmKhYlVoUEw 6T/KZ0264Kc0H3Ouc2Ze2UOokcQqzlEtPrRzjoYzs6tWWWfzIxWqicAeh2mIfuFGkANb lsvP6DJUpWmpzhgpcXn9z6d8XaKzmN7SWNVw3jIo29H/xLeE+5G1ymNUt3tbooVp4VrF 02QiIM9/9ePp20Z7PMEBcgruiUP0rOjzMu7WsmkDK7RByk0YH59AVJ7jxYirK/7kzv5T LQ+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=GzfUNB1R; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id s14si5906463wrf.380.2017.10.27.09.50.42; Fri, 27 Oct 2017 09:50:43 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=GzfUNB1R; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4D91968A0BE; Fri, 27 Oct 2017 19:50:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7146F689D6B for ; Fri, 27 Oct 2017 19:50:27 +0300 (EEST) Received: by mail-wr0-f194.google.com with SMTP id l8so6715759wre.12 for ; Fri, 27 Oct 2017 09:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=PoyVnQ2FO8kVqtg8fWmQHX39vMZw+akFwMXmdMPxIDE=; b=GzfUNB1R/F8mnd3yBxsCAHQFhZUFEyGVVCtQmXLN/mZTgHEpnRiC0qFoTNbstI/Z5E hjPZ3ihbH6dQUH73oFy2nTdvux7Bq/PYgOQ3B0tVqsv35hBkOoNhvrI0noybE0B+rV59 iHyiVnV2JdKPwG667N5XJT61GNe2kFVDg0Nw9cKOWiDMLOzPZJEbSCGlQleIQYIiX5lI gTAt1zY2RC76J+GYY5p0nqojSYBmq3qHSi68a/Wox4gz3jNSQWNFMCXu0d6zpb1QoVib ECejDE7jsXiJ1td/YIACsfvr5kaip9/ABq1sWBCMf/Ww7+wJYJ+DqJN4RfZB6ldSl6QZ 77Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=PoyVnQ2FO8kVqtg8fWmQHX39vMZw+akFwMXmdMPxIDE=; b=mhc3JQEsGuwKvnP1l831eLvnuh/W/zIJQv4QTa46pLv/qJK9Bte/UVnRs+pYPceZRj dGKXyvvLg1cf9IY+2YbPwCYV98r917XQzEG+fglKpJktfAIFJvKEorf2WM02IAcUzZIA VMmkhsdZkaO8xzTfAhjPwc7bQ5RVgaGkAvuKDsRfIlwv0N+CKWUmK8vrFKId9OpqxhwH B/VCf1zhkE767ozFdkEJigbhLx9WU471gGyyLpNmmKnAqjir/26rsn54YLE7gogOp38i OuMVgiVwIgFPsHBWWQh0287/z4EJNcoIh9n8s9S41AXLqt0if76D3gRJrHlaJKNMnmrj hWLA== X-Gm-Message-State: AMCzsaV9ZgngtPhmx7k5wK5OCEUeatb0VzobQfj3TnqWUApwAC/Tz9Xp 51mqvsWnOqyQi4QS6tqfeR1XMA== X-Received: by 10.223.184.140 with SMTP id i12mr920506wrf.31.1509123035280; Fri, 27 Oct 2017 09:50:35 -0700 (PDT) Received: from localhost.localdomain ([94.250.174.60]) by smtp.gmail.com with ESMTPSA id k9sm9346903wrk.88.2017.10.27.09.50.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Oct 2017 09:50:34 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Fri, 27 Oct 2017 18:49:52 +0200 Message-Id: <20171027164952.6510-1-onemda@gmail.com> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] avfilter/vf_tile: remove limit of max tile 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Paul B Mahol --- libavfilter/vf_tile.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/libavfilter/vf_tile.c b/libavfilter/vf_tile.c index 87e0b940cf..368e4f1a82 100644 --- a/libavfilter/vf_tile.c +++ b/libavfilter/vf_tile.c @@ -44,8 +44,6 @@ typedef struct TileContext { uint8_t rgba_color[4]; } TileContext; -#define REASONABLE_SIZE 1024 - #define OFFSET(x) offsetof(TileContext, x) #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM @@ -68,12 +66,6 @@ static av_cold int init(AVFilterContext *ctx) { TileContext *tile = ctx->priv; - if (tile->w > REASONABLE_SIZE || tile->h > REASONABLE_SIZE) { - av_log(ctx, AV_LOG_ERROR, "Tile size %ux%u is insane.\n", - tile->w, tile->h); - return AVERROR(EINVAL); - } - if (tile->nb_frames == 0) { tile->nb_frames = tile->w * tile->h; } else if (tile->nb_frames > tile->w * tile->h) { @@ -98,12 +90,12 @@ static int config_props(AVFilterLink *outlink) const unsigned total_margin_w = (tile->w - 1) * tile->padding + 2*tile->margin; const unsigned total_margin_h = (tile->h - 1) * tile->padding + 2*tile->margin; - if (inlink->w > (INT_MAX - total_margin_w) / tile->w) { + if (inlink->w > (INT16_MAX - total_margin_w) / tile->w) { av_log(ctx, AV_LOG_ERROR, "Total width %ux%u is too much.\n", tile->w, inlink->w); return AVERROR(EINVAL); } - if (inlink->h > (INT_MAX - total_margin_h) / tile->h) { + if (inlink->h > (INT16_MAX - total_margin_h) / tile->h) { av_log(ctx, AV_LOG_ERROR, "Total height %ux%u is too much.\n", tile->h, inlink->h); return AVERROR(EINVAL);