From patchwork Sun Sep 8 23:50:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Scholz X-Patchwork-Id: 51406 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9c4f:0:b0:48e:c0f8:d0de with SMTP id w15csp1359020vqu; Sun, 8 Sep 2024 18:03:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUjU9GGMQtokLl8KO3Hb8a++hHUY4xBgbq4Z3CFwnaJjeZf7EJOdTx/1yF0/xkGF6pff4InS7+XjPZbZahT6vbX@gmail.com X-Google-Smtp-Source: AGHT+IHaOfnXol96AzdIvs9/if0Lcg6bmRZREEfy7oK9xD+Ixap6ghQ9XhZJ2kBALwdOXctnXOZU X-Received: by 2002:a05:651c:543:b0:2f6:c683:553d with SMTP id 38308e7fff4ca-2f75a986f2emr41710031fa.15.1725843785217; Sun, 08 Sep 2024 18:03:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725843785; cv=none; d=google.com; s=arc-20240605; b=i0WQCfbOzDyCLxESf6ZCbHkVdKJU5v+cC18gn0Lfm7LmOF4EMWh94pjFHBKH3nUgn7 T2DnsUko7RYxsbZX6CegDA7k/XVV9TqpJWEy15nsQ2b1NMhBhhhFNlLQcPjiFIxZDMlT +k+xOBzwMlRaoCpm384t57vODbnyqqE0qaZEcJUziSBfe+qB8unrdliLt+WFSWOYPqDK 00PP5tQo3Jd8j5wEDrlbuRVRe2py7ueQgglUv0qPZb4bn3OPQNxBLch+VuXOo24r4YC/ e++HyAzotUJ6Y/fAbVHe+WSHYEBVWrfBkZ2QkrZ6Ai71kXk15XOMuo2gqfdw4gzQtctO y6UQ== 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=lIjwgUn5SQ47W7HNyFV/+VXtDaKtuwsuTnoKbPu+W3E=; fh=5IeVwzS1vbVKjIV8MP3mnmnRtZGb8uteQ9r4QD2keV0=; b=etBxSHAlmXqSgx5pPughYbUsEQtLlneUcyKsIzEcUWMJwLwiszjEx4vt4Hdc3VANpA s3aeKFZ1NaVrxSiYKKMtaVscQqh+ejIdVttIAJdGUFJEZRLL4mh8OyWGyV6DnUNELGCy wIDVh3cwiLtyVJDuTCvmdGloA55McrIoss/sO289bcHpHtVvmLPy2fF3T3U6DbvuHb5C 32MLnli74a+YELHEb4FABz9GT9D7y2jSJaCtyy8R4fnFaIq1t7/tK/hC3xZxVg5C6xQv mwwY+FGGVDstD9mq2xc4h6dTZtZIrK8LemgngdcttdB9UXq+RP5cvutpwDcGG/ZBCbAp sn5w==; 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="Rxictfg/"; 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 38308e7fff4ca-2f75c08731asi12124821fa.400.2024.09.08.18.03.04; Sun, 08 Sep 2024 18:03:05 -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="Rxictfg/"; 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 043E968DE44; Mon, 9 Sep 2024 03:56:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 77D8F68DD66 for ; Mon, 9 Sep 2024 03:55:47 +0300 (EEST) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-42cb57f8b41so8009065e9.0 for ; Sun, 08 Sep 2024 17:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725843347; x=1726448147; darn=ffmpeg.org; h=subject:date:from:to:message-id:in-reply-to:from:to:cc:subject:date :message-id:reply-to; bh=pb01r82aJezxY31Vgl+JrxGwPokJSD8/cWLmtx4gM5M=; b=Rxictfg/h8x+WY/OvIKZUV/+oHKGCPTCmTrE7O8piUJZH6L6KwDS1Q8q9cjjxQ8/Tf um85+Nru+WxknPX98k64qdDfzY7oyNjtJySa19d0csCfErE8W5tulG5Dr8JViSbohdLL hNageQC6kNWS/WFN9cu7ecLvmAL0CQCqkQpoH76JwvoKgO6FuALlH/I/VquYfs/A8wkO DhTYnV7Ace/QU/PYzAvCDdGpMNhJq8JQN2enfU7EnLP7G9nadWdLWX8jAlVvf5RLvZQb /sboQozlsx6rok8BD3AA5VZxTrJAq9Cl+X9rhbXavxi3HppEcg/gnAKRG1Mc3yglD8Tc +sGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725843347; x=1726448147; h=subject:date:from:to:message-id:in-reply-to:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pb01r82aJezxY31Vgl+JrxGwPokJSD8/cWLmtx4gM5M=; b=vgZrFAVfO3wCV27v06TfkpaQkh+DBhCodynEfLUx3FlHuzzztRd+IU2aEm8e2eDkRA 4rA/Sl8hqAP3Ihgc2zhZXzS0eTHRn7awmEaDgFDofo7m0Pkc1S6xqHblER/FvbdLPsyS Wp5CfFJDBWZt+iPBWfsPzdp9hj+4a1tJ7HSFm/6DrW0Jwn3ERZ+QTag/pLL0PAFg0wyu KStFuoKDDnEueSQuB9uXgsQ1kfTv5YU//cbgHLUyNxH1h2XfiHliYdcHoYPtEIFigdsN R2kJ2T2yvie9ekCxrT72+EA8Uf1CG9ZzXkcx0/wPgWF2so0gk3Rmy2+aNnacStOv2mKv qKxQ== X-Gm-Message-State: AOJu0YyJ7aw3nqLuPxT6p/QbXJBLIEELtRjeVXeETXUGn9cCYo0FbRfE 7YJX8R/+84z/hdCaVl09Q29sJjVDi1hDMC132MOh38v0zC0FaT0129q5LA== X-Received: by 2002:a5d:5cc5:0:b0:374:bcdc:6257 with SMTP id ffacd0b85a97d-37892466eecmr3964218f8f.54.1725843346804; Sun, 08 Sep 2024 17:55:46 -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.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Sep 2024 17:55:46 -0700 (PDT) In-Reply-To: Message-Id: To: From: "Marvin Scholz" Date: Mon, 9 Sep 2024 01:50:35 +0200 Subject: [FFmpeg-devel] [PATCH 50/60] avformat/rawdec: 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: tzN6xuNIvW9i --- libavformat/rawdec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c index d0c829dc42..c7c18f9aac 100644 --- a/libavformat/rawdec.c +++ b/libavformat/rawdec.c @@ -161,12 +161,11 @@ const FFInputFormat ff_data_demuxer = { #if CONFIG_MJPEG_DEMUXER static int mjpeg_probe(const AVProbeData *p) { - int i; int state = -1; int nb_invalid = 0; int nb_frames = 0; - for (i = 0; i < p->buf_size - 1; i++) { + for (int i = 0; i < p->buf_size - 1; i++) { int c; if (p->buf[i] != 0xFF) continue; @@ -211,9 +210,8 @@ static int mjpeg_probe(const AVProbeData *p) if (nb_invalid*4 + 1 < nb_frames) { static const char ct_jpeg[] = "\r\nContent-Type: image/jpeg\r\n"; - int i; - for (i=0; ibuf_size - (int)sizeof(ct_jpeg), 100); i++) + for (int i = 0; i < FFMIN(p->buf_size - (int)sizeof(ct_jpeg), 100); i++) if (!memcmp(p->buf + i, ct_jpeg, sizeof(ct_jpeg) - 1)) return AVPROBE_SCORE_EXTENSION;