From patchwork Sun Sep 8 21:25:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Scholz X-Patchwork-Id: 51477 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9c4f:0:b0:48e:c0f8:d0de with SMTP id w15csp1595294vqu; Mon, 9 Sep 2024 05:14:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVQaatMKG4wVRHbv2lwwZT7xJR/LH/jJ3ryzHRei1b69kTwM0040cbpkz71IeRX2LqnR0xSuaibtByzqkefePQj@gmail.com X-Google-Smtp-Source: AGHT+IGRjp8mEZqsdqgPM1+0k4D1/8/dMfpjs+2slmBxDTC+kyjzNs5kWy0InPZlJxvY2nNk1e5F X-Received: by 2002:a17:907:da3:b0:a79:a1b2:1a5e with SMTP id a640c23a62f3a-a8a88909224mr391803166b.10.1725884049715; Mon, 09 Sep 2024 05:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725884049; cv=none; d=google.com; s=arc-20240605; b=SwY2tZ8Sy10ODnPfsn910lssn/Jl7y5F7kaWPs4AyN4VyepulI395istWcrMaAxU8B W9Y99jDufQItZpyFgpekGd0sjFrCBNH353bAPfGwIrXJidZak2jjodIbht22ZOHl8VQ2 EkmMrvS76JdzmVmu7nJLkkIInlYzFtD07E6+hDB+I3qYKCEW5eUtnQz4QcYDkoxfhUDz hhClCz7urEVz4eucWFCw3dvDwqPs3buL8b1vxnfJ6QjEMXJk9xDyw5kdfBafzxfRTeqP rAqeD+mybvs8R1oelpleMeBLt/Kb1iCj1yPtMUw+U3SOfpy+YMf4iRsA1vfEeNZl9AHx +csg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:date:from:to:message-id:in-reply-to :dkim-signature:delivered-to; bh=kImdJGMw9xhO6fEtCdDsdGZ+xlex1+Urm4kZTseBPJY=; fh=5IeVwzS1vbVKjIV8MP3mnmnRtZGb8uteQ9r4QD2keV0=; b=idO6DrTHGCqi7IOHHoglqh3IsdyAXbUKJ9MpEHRPLAGIwpS6M1TmtozxSluDE3nTqF OhZDEreHpzOuq2ePT/YdcFTGjGGiZ0O9CTwI3Xi/pyZ3I7J1CvX5nK3BIvodxv9qPCD3 O51ZTL7YV7ZRIrVHIgVSj8zT0YB59Us2g7kWN3FHkM0S+AKyO+1tYFGKn8eMGB6X2Bi2 JaicidpLUhsHmTfP3nP9jSBmnrwhWBDs/AjLtma2kWGMiCNozmBX1nqLAPFT3TMng6F3 7orzkcQvLEPpyjwVqhU0UnPBNrPHP08tmjbl/RMwg3SFZrhn6pZjWX6/EYEIb7Xt9P6I 2Xhw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=Wulk0gTn; 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=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@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 a640c23a62f3a-a8d25c515e6si344191366b.340.2024.09.09.05.14.09; Mon, 09 Sep 2024 05:14:09 -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=20230601 header.b=Wulk0gTn; 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=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3960868DD29; Mon, 9 Sep 2024 03:55:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 13F2E68DB24 for ; Mon, 9 Sep 2024 03:55:26 +0300 (EEST) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42cb9a0c300so659285e9.0 for ; Sun, 08 Sep 2024 17:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725843325; x=1726448125; darn=ffmpeg.org; h=subject:date:from:to:message-id:in-reply-to:from:to:cc:subject:date :message-id:reply-to; bh=nuAbcLtI9oTTzh4Ttr6h/J/D9Wtcom1IcjRMTeR6pdI=; b=Wulk0gTnbHX3vsFbtVRil9v/V2Vydndvu45CR+/a87Q1Fjf/htfmmrCkz9hHfFMkE5 PsxQupbVnW9bSrCTisgps1JsndYzZrYsxVuRZg1ckS32UNI/5nY/ZjK0UlCkPOpbc5hq TPH1rQYg+RH5zBllCugDb4qmlh4pWfdtwuV4T+wtTM5wfs10q/H9EzNTZdUd8H8CEdwJ k1W93wUPspAiWhXy9NrlBGNsqrbgY2A5UmDYcFkKohboR5EB+ryxrrZVZh7Xl8YPpv82 9eaJnoRUCBNbma/gelnOydeVF3+J9OLTsSfMzP6uc8mZhuyChuVa//C/f3Y9mWlnQLgT WGaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725843325; x=1726448125; h=subject:date:from:to:message-id:in-reply-to:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nuAbcLtI9oTTzh4Ttr6h/J/D9Wtcom1IcjRMTeR6pdI=; b=d1btGuy/TgrEWPy107A6lrKl3ArBP4Mv9rxcLhyNR0Df9Gn9lRijG06/If6bL1+S/o KomxtUyamrq/XJ/V1nkbzF7A5gRiKK7B/0Ks1sqbiEJlAQZGCkdWwk12Sap/SvaUeXF6 S58VeBZjGf9mVQENILRWQVFabzEKHLLlF6NsLsxRBuItB6ZV6xvLD2vsEYwATzlJ5eA3 EE/rzs9JsfhZRVahivVx7Yt307z3wyAumdZfcO3LhCZDp+7kJ34UJ8uX9RkzBZo+vRHJ 6oCHk/Xt8DCn7XlB7U0PjJFF/EEEeq1ng41luE/l150btAUmYljsutj44AWJSCPJ/o71 CoZQ== X-Gm-Message-State: AOJu0YzwWUCl87d12WdSC9Et1AO/UF9S6bxEZruriyqrT94KvXLPRAiz fiGLKnN32Yr8jH/wAQNLJxTgZIt+wjQTZaxtRn4gxTyPNfvVJjvPpJApZA== X-Received: by 2002:a05:600c:4707:b0:426:5dd0:a1ee with SMTP id 5b1f17b1804b1-42c9f97bc2amr68372245e9.2.1725843325387; Sun, 08 Sep 2024 17:55:25 -0700 (PDT) Received: from localhost (p200300cccf1178009d94fda8472792f7.dip0.t-ipconnect.de. [2003:cc:cf11:7800:9d94:fda8:4727:92f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895649728sm4583399f8f.16.2024.09.08.17.55.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Sep 2024 17:55:24 -0700 (PDT) In-Reply-To: Message-Id: To: From: "Marvin Scholz" Date: Sun, 8 Sep 2024 23:25:51 +0200 Subject: [FFmpeg-devel] [PATCH 26/60] avcodec/g2meet: fix variable shadowing 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: 1eJGJDVv8XtW --- libavcodec/g2meet.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 7ae987ec40..f952a06f12 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -1052,7 +1052,6 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y, { int width, height; int hdr, zsize, npal, tidx = -1, ret; - int i, j; const uint8_t *src_end = src + src_size; uint8_t pal[768], transp[3]; uLongf dlen = (c->tile_width + 1) * c->tile_height; @@ -1071,11 +1070,10 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y, hdr = *src++; sub_type = hdr >> 5; if (sub_type == 0) { - int j; memcpy(transp, src, 3); src += 3; - for (j = 0; j < height; j++, dst += c->framebuf_stride) - for (i = 0; i < width; i++) + for (int j = 0; j < height; j++, dst += c->framebuf_stride) + for (int i = 0; i < width; i++) memcpy(dst + i * 3, transp, 3); return 0; } else if (sub_type == 1) { @@ -1093,7 +1091,7 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y, memcpy(pal, src, npal * 3); src += npal * 3; if (sub_type != 2) { - for (i = 0; i < npal; i++) { + for (int i = 0; i < npal; i++) { if (!memcmp(pal + i * 3, transp, 3)) { tidx = i; break; @@ -1125,8 +1123,8 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y, bstride = FFALIGN(width, 16) >> 3; // blocks are coded LSB and we need normal bitreader for JPEG data bits = 0; - for (i = 0; i < (FFALIGN(height, 16) >> 4); i++) { - for (j = 0; j < (FFALIGN(width, 16) >> 4); j++) { + for (int i = 0; i < (FFALIGN(height, 16) >> 4); i++) { + for (int j = 0; j < (FFALIGN(width, 16) >> 4); j++) { if (!bits) { if (src >= src_end) return AVERROR_INVALIDDATA;