From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4F1C545160 for ; Sun, 12 Mar 2023 19:42:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1914868BB28; Sun, 12 Mar 2023 21:42:44 +0200 (EET) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 53AFB68AF9E for ; Sun, 12 Mar 2023 21:42:37 +0200 (EET) Received: by mail-lf1-f42.google.com with SMTP id f18so13165956lfa.3 for ; Sun, 12 Mar 2023 12:42:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678650156; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=vNG+Evn5VAWHx82HX8tgHWEVdQw9GuCju827E94nC30=; b=jVeYH4Ik9qqI0mPSFkJEUreaabXpZJG2L6mOQqrlrqn7d2QPMEYpfkWbSQnWtWbdxF xoKaWbAK96oTg6uANQtMl1DVn1TExPFSeyuzI3MyhDpwNuyEMXVWjmBbjUdoPGldc+Nx 0tzLzXcfJjEBP5ukaqghPVHPwrPvxlzshPVMQ1R/5BzdjLVn1UpsuMZ2E6XnNezIiCYK fmq0xxQSjOXcND8XK1a8MjYVsa9dWnhwsce7vByXXPvJgDAIk6QMEJJELsHmc+2TgN7X qw88G6oT/LAvT0A8FrDwQ9dleD9Es8AGB4+m3v7+mjjAdQmDbnpCo9JXMXevdQsuMg0l LemQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678650156; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vNG+Evn5VAWHx82HX8tgHWEVdQw9GuCju827E94nC30=; b=XRsO5jgtHVN4r7iPoAAhl00gOGzoHgqBqa19ZWNxbEPaH0REMlAioY6YXEPdEk7p/t Lw4brWhbdTvJPJ7JPYgYdr4hw2cavZ0UDt+hZL2drIAheM38CT24PfoMmLyGSZlNz8I1 JsK7/825JBC2YLWIuYEf6EwT6eQbbB/OmJ11NiONvPqdsrMjwJZw5qquFoCEJqh3CyHr 2/Bl0saSyY2hYdmnk5vPtFtSbYmWJC/Nd2ytcX5bTOn9AGFzY3Qfg+ftt9YtJE7RT9dH YeOUltSwGjX+dwiZ6k62yDCZr8lLM20gSq63T+LFS2NVO49+lPV3t+JJqXLBJ3q3J3TM WFQQ== X-Gm-Message-State: AO0yUKU1utCa80OPyVhQHfDdfF4USz+svRvk0A2nnkhBaZsu5qhq4Ptd ZYcbnoGA1/BIdN2GFIoaMIlbFvn7HBE= X-Google-Smtp-Source: AK7set9+5Wl0u4ZJaO74zSxlJ5ijtIMMcvXI9mMyaAOPko+7XGiNWGgrxiccVGhYP3DkvrIlzEqwuw== X-Received: by 2002:ac2:46e5:0:b0:4dd:a7bc:58e2 with SMTP id q5-20020ac246e5000000b004dda7bc58e2mr8683185lfo.41.1678650156244; Sun, 12 Mar 2023 12:42:36 -0700 (PDT) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id 25-20020ac25699000000b004db44dfd888sm731902lfr.30.2023.03.12.12.42.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 12:42:35 -0700 (PDT) From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Sun, 12 Mar 2023 21:42:30 +0200 Message-Id: <20230312194230.175999-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avutil/frame: move wipe_side_data counter to its utilized scope 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Originally in 77b2cd7b41d7ec8008b6fac753c04f77824c514c this counter was separate in av_frame_unref, in which the same counter was re-utilized multiple times over multiple loops. This code was then refactored into wipe_side_data as-is in 5d839778b9f3edb682b7f71dde4f80f07c75b098 , keeping the location of counter initialization. This was unnecessary, as the counter was no longer utilized outside of the for loop's scope and thus could reside within the loop itself. --- libavutil/frame.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavutil/frame.c b/libavutil/frame.c index 9545477acc..d06a673779 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -74,9 +74,7 @@ static void free_side_data(AVFrameSideData **ptr_sd) static void wipe_side_data(AVFrame *frame) { - int i; - - for (i = 0; i < frame->nb_side_data; i++) { + for (int i = 0; i < frame->nb_side_data; i++) { free_side_data(&frame->side_data[i]); } frame->nb_side_data = 0; -- 2.39.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".