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 0DE7A46943 for ; Sun, 24 Mar 2024 11:23:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1DEAC68D35C; Sun, 24 Mar 2024 13:23:40 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BFA5968D239 for ; Sun, 24 Mar 2024 13:23:33 +0200 (EET) Authentication-Results: mail0.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=N1ohW3vf; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 711E6240DAC for ; Sun, 24 Mar 2024 12:23:33 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id d_0NiZx06Kwu for ; Sun, 24 Mar 2024 12:23:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1711279412; bh=8VhGX19KC9OBTw0bzx0VW+JV7RXbGTRWgzBW4xKYYVM=; h=Subject:From:To:In-Reply-To:References:Date:From; b=N1ohW3vfrnuamT5lAVURKHTJ2/p7d830IQULqu3EjRLXyRx5sNbBDgJkVAsmqYAoO wyN+OOJRsQieOYFGgwbr7fWTX923ewWnow0RwR55o5aqsECJjBXRoqppQDMOxL0el0 jpk1DxLwD+awDSPsbg3P4BkVZ5t9HKTKwtpuoBWukamzw+WHQHK9EaM4zDeQl7ABM/ 3jsai3qjXc3JOsuKNfv+tAxX3PdFUw8Vukj68+WEUGdU9o7nwzBTvBmJYjkqIjI+zr 4ATx6kEVQivqLw9MiDEVT1CahgDMBdDJgFSsDECyq3h2I/142FybXxA+eZs23Z67eB 8qfIksOF9i6TQ== Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id AA3462404AF for ; Sun, 24 Mar 2024 12:23:32 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id 841BD1601B9; Sun, 24 Mar 2024 12:23:32 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: <20240323140054.4222-1-anton@khirnov.net> <171127245802.7287.14513769027741252141@lain.khirnov.net> <171127643259.1646.17791906321816556629@lain.khirnov.net> Mail-Followup-To: FFmpeg development discussions and patches Date: Sun, 24 Mar 2024 12:23:32 +0100 Message-ID: <171127941251.1646.3410638245731734758@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v2 08/12] lavc/frame_thread_encoder: avoid assigning a whole AVCodecContext 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: Quoting Andreas Rheinhardt (2024-03-24 12:10:24) > Anton Khirnov: > > Quoting Andreas Rheinhardt (2024-03-24 11:19:19) > >> Anton Khirnov: > >>> Quoting Andreas Rheinhardt (2024-03-23 15:11:59) > >>>> 1. The earlier code would just work in case the user used a smaller > >>>> number of elements for the matrices if these matrices were not used at > >>>> all (which happens for the majority of encoders). This is no longer true > >>>> with this patch. > >>> > >>> So? > >>> > >> > >> It means there is a scenario where you break something. > > > > There is no way for the caller to know whether, and how much, will lavc > > read from those tables, so it's invalid API use. > > > > Incorrect: Given that these fields do not a length field, it is legal to > put pointers to matrices of arbitrary length in the relevant > AVCodecContext field. No. Users are not allowed to write random values to random places. The only meaningful way to use these arrays is with 64 elements, therefore any caller using a different number is broken. -- Anton Khirnov _______________________________________________ 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".