From patchwork Sat Feb 4 18:04:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 2423 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp1147333vsb; Sat, 4 Feb 2017 10:04:52 -0800 (PST) X-Received: by 10.28.225.215 with SMTP id y206mr2440142wmg.138.1486231492190; Sat, 04 Feb 2017 10:04:52 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h124si2137521wmg.61.2017.02.04.10.04.51; Sat, 04 Feb 2017 10:04:52 -0800 (PST) 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=@tmm1-net.20150623.gappssmtp.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 BC3CE6899A8; Sat, 4 Feb 2017 20:04:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 396F068995A for ; Sat, 4 Feb 2017 20:04:41 +0200 (EET) Received: by mail-pf0-f196.google.com with SMTP id 19so3844875pfo.3 for ; Sat, 04 Feb 2017 10:04:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tmm1-net.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=gDroMD++Qn3pcrVYkzaQtdk31E3Uv6p5/d6T5D5rRFA=; b=XpjaLlNWk5AjB1YGiZE1p7V3VS1qC+FzFfRden8hhgvtNgw5iWa+lvA2Lkfq991QPI UJUgv0XCkA246h4B3lj5thjQmoPwDOc6lvmfPjiGO8b4omk+QbwBa9t+iKXeCLmNNb7i L6l99PMDmpkhBUQTxV8SPC31sLK+i1T2pt7agPYEoWFFp+dKgdMzXw8vbgWoIzCs2YUo CdI/wADAU+1L4XlMla8lr2ZxmvZZ7HaP3Lkr8jZmbP3Ga4VG/t217xCIGouuwlBkYJzq A6XDriZDapRWDyTdoocC+Rpec1NLoJTDWijnwruQtdSKSN4TZv11OFLWulhLpWaVFBi9 iJrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=gDroMD++Qn3pcrVYkzaQtdk31E3Uv6p5/d6T5D5rRFA=; b=X57XcIKKj53EKxFga/T36MMaJjYKSbOlIW/DfqcEBT8t4R4m5Grak64Haw8LMxOVJA bVGM30AE60scJGRlRwl1u+IzLRNlyQ056art57nsrNJw6w6QNiFgW9cyjp51RjhfYTJt 5qk7eAA7CmBb5+amFomkzGtwxtezX07RwIWxjtQgzuTQRL15H4uV3KDSqjmnfCo8XnNs l2fUe0uP1r3RQXCAlPa+4WFGSpB+TF2mi557Om+zroZJ81O+ef96q8miA4J3iYpYZgj9 AnkXYEqHGRlO0jMVIrkyUcaSmT8enR/rx8qbqcAS62Odl1YM+VTsMZnXlYFXgc92rtEL z9Xw== X-Gm-Message-State: AIkVDXKBIMlxxBNxjI6rP0d/6suG7gs855tbd9cimGr60pfVdmKFsdojjzwYdDp472/MIw== X-Received: by 10.84.150.129 with SMTP id h1mr5102379plh.9.1486231481284; Sat, 04 Feb 2017 10:04:41 -0800 (PST) Received: from tmm1-macbook.local.net (c-73-252-174-83.hsd1.ca.comcast.net. [73.252.174.83]) by smtp.gmail.com with ESMTPSA id c11sm76747452pfe.68.2017.02.04.10.04.40 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 04 Feb 2017 10:04:40 -0800 (PST) From: Aman Gupta To: ffmpeg-devel@ffmpeg.org Date: Sat, 4 Feb 2017 10:04:36 -0800 Message-Id: <20170204180436.78982-1-ffmpeg@tmm1.net> X-Mailer: git-send-email 2.10.1 (Apple Git-78) Subject: [FFmpeg-devel] [PATCH] avfilter/scale: use int64_t for height/width calculation to address overflow 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: Aman Gupta MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Aman Gupta --- libavfilter/scale.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/scale.c b/libavfilter/scale.c index 50cd442..9725f1f 100644 --- a/libavfilter/scale.c +++ b/libavfilter/scale.c @@ -68,7 +68,7 @@ int ff_scale_eval_dimensions(void *log_ctx, const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); const AVPixFmtDescriptor *out_desc = av_pix_fmt_desc_get(outlink->format); const char *expr; - int w, h; + int64_t w, h; int factor_w, factor_h; int eval_w, eval_h; int ret; @@ -138,8 +138,8 @@ int ff_scale_eval_dimensions(void *log_ctx, if (h < 0) h = av_rescale(w, inlink->h, inlink->w * factor_h) * factor_h; - *ret_w = w; - *ret_h = h; + *ret_w = (int)w; + *ret_h = (int)h; return 0;