From patchwork Fri Jun 4 02:22:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Fu, Ting" X-Patchwork-Id: 28078 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp669623iof; Thu, 3 Jun 2021 19:33:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxguPvvK8Q81eqgJTCwM+XE1O5eq/wMpvME79bpTD+NvEO6JeYzWTNdTIv+H50bNjkbaN19 X-Received: by 2002:a17:906:ccd9:: with SMTP id ot25mr2000374ejb.386.1622774012901; Thu, 03 Jun 2021 19:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622774012; cv=none; d=google.com; s=arc-20160816; b=pk2GTC5Sn0KBrOQjZYT9NWP0Dp53U1QFcOu290cJwH1A4cMYEpG21vhpPN+d5yOAae ge+TiHoDoxVSmV0Vq0tP7afACeabKs3/xlpx++NHiDRX+cTjHt2mdzFxS1/4lpDFXG25 gTeRMDeP/KFGoI/y+rylI8Kpgvz3tQI8PjfDMg3wyfrVSeobLDKzh7IhqX7HFd7wC3oz 1x9CbSgL9YlDcvhq1hD4RjAAHR+af93ui5oUOlqiMZnSappbDdir+u7bVpF2DMf7ANE8 tfnfR8cF5tbZEP3GDgmWJl5t+2nS3mb2+C7jvo5VEREdbMr1KzgN53lzfgtVBxGcv2zv hu4Q== 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:ironport-sdr :ironport-sdr:delivered-to; bh=etz3tIyFVrwIgBS5MllgLx8JXFCocMUC1hh0FBPoi9s=; b=cDpreNVSQjeP8b4qXKffGbQVZXtglAn6ucU5/3yAsyqHATk/KSXy4ZTw2p406vrUHu rUAwCYQn3w34OllGfzB0rAXNyOE3rBmMZcKAFuTpkgbrtjE8SjfxcfJWm0OIn0z50YcS rxQfAz+srt+Au6Ii5JVHITfxzsqFw47b9JS1vhmDCLf4XwGGqWvGzIXKNF61NLIVuG46 qRxce55bW02pMKG3EJJp8BQ7/b97jwvtM4kWWKkTPauPlDtZTQm2sG2fdEiNcZxR8NOg 6FuzUrh2CSV7VFq5znkdbefrnpmrIOQzkWx30XXeqk71JmNaB8iUjIBgyPoepGVNfRJa pm3A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m9si3690553eds.467.2021.06.03.19.33.32; Thu, 03 Jun 2021 19:33:32 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DE101687FB2; Fri, 4 Jun 2021 05:33:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D4520687FB2 for ; Fri, 4 Jun 2021 05:33:20 +0300 (EEST) IronPort-SDR: IQPW1Usou95tSSZN9zr1JxGSdLOsofgwtgpE4/3uU3fA2xenGNFjp8RLgaCccDvavweu5YLsdL E9LmiyxKKsaQ== X-IronPort-AV: E=McAfee;i="6200,9189,10004"; a="225518762" X-IronPort-AV: E=Sophos;i="5.83,246,1616482800"; d="scan'208";a="225518762" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2021 19:33:13 -0700 IronPort-SDR: Sy4u+bxJdg6k1UTiKaSr8+8/JYh9ZKo8/z5+LkeqCeaapGJb4FzQyBKG1sxbSuCX0HdQKEjAL/ wLR1dnsCVTQg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,246,1616482800"; d="scan'208";a="483725988" Received: from semmer-ubuntu.sh.intel.com ([10.239.159.83]) by fmsmga002.fm.intel.com with ESMTP; 03 Jun 2021 19:33:12 -0700 From: Ting Fu To: ffmpeg-devel@ffmpeg.org Date: Fri, 4 Jun 2021 10:22:45 +0800 Message-Id: <20210604022246.5193-1-ting.fu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 1/2] lavfi/vf_drawbox.c: fix CID 1485004 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: Kg4BXqFMvjEL CID 1485004: Uninitialized variables (UNINIT) Using uninitialized value "x" when calling "*pixel_belongs_to_region". Signed-off-by: Ting Fu --- libavfilter/vf_drawbox.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c index fff78862e9..1e9e028650 100644 --- a/libavfilter/vf_drawbox.c +++ b/libavfilter/vf_drawbox.c @@ -126,8 +126,9 @@ static void draw_region(AVFrame *frame, DrawBoxContext *ctx, int left, int top, for (y = top; y < down; y++) { ASSIGN_THREE_CHANNELS if (ctx->invert_color) { - if (pixel_belongs_to_region(ctx, x, y)) - row[0][x] = 0xff - row[0][x]; + for (x = left; x < right; x++) + if (pixel_belongs_to_region(ctx, x, y)) + row[0][x] = 0xff - row[0][x]; } else { for (x = left; x < right; x++) { double alpha = (double)ctx->yuv_color[A] / 255;