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 CF90C4AE9B for ; Wed, 26 Jun 2024 06:36:56 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 55CDF68D58B; Wed, 26 Jun 2024 09:36:53 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1FCD868C0D8 for ; Wed, 26 Jun 2024 09:36:47 +0300 (EEST) 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=PRtg9uaW; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id C5651240DAC for ; Wed, 26 Jun 2024 08:36:46 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id ZXbjduKElzrB for ; Wed, 26 Jun 2024 08:36:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1719383806; bh=VEK5wMaEvjVjrbQZZnB4CFP5MS4vcY6WlOOozDT2c0I=; h=Subject:From:To:In-Reply-To:References:Date:From; b=PRtg9uaWSH8KnwybtYayBwISfwj1bgLIA352tCnNNCYR+rMw7JaV0XjykctSpVXhx G4oE+HtWsQ7R41yHYo3oI/CzBhwdIUwrELMJ9ndE2uJxmjfahvhjZpux9nuDjuwezU M/mteOP45meX4j3BLeQaRT83ik0CTBjqYcUgFuvPBMzSTl63gdJW0yCv8/h1u2IraA L3jURA8KyhK+yOxdkCbtm2ThsLuh4hAm8tN2gK9tUsI1d7BOeQnYkwMGaajK3AUp/z 7TBHijinVnPNGMAIibOiM7yJqzcfJKGdLDu/Xvw6/ropwPY8pgjM06X3VYSD5Momw+ +I6WB6ghazFeQ== 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 324972404E5 for ; Wed, 26 Jun 2024 08:36:46 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id 1DC8D1601B9; Wed, 26 Jun 2024 08:36:46 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20240625232736.GO4991@pb2> References: <20240623230137.1749178-1-michael@niedermayer.cc> <20240623230137.1749178-2-michael@niedermayer.cc> <171930595471.21847.5930175805645108289@lain.khirnov.net> <20240625232736.GO4991@pb2> Mail-Followup-To: FFmpeg development discussions and patches Date: Wed, 26 Jun 2024 08:36:46 +0200 Message-ID: <171938380610.21847.18409539697484039620@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 2/5] avcodec/hevc/hevcdec: Do not allow changes to parameter sets between slices 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 Michael Niedermayer (2024-06-26 01:27:36) > The specification explcitly doesnt allow the active *PS to change > > "Any PPS NAL unit containing the value of pps_pic_parameter_set_id for the active PPS RBSP for a coded picture (and > consequently for the layer containing the coded picture) shall have the same content as that of the active PPS RBSP for the > coded picture, unless it follows the last VCL NAL unit of the coded picture and precedes the first VCL NAL unit of another > coded picture." > > "Any SPS NAL unit with nuh_layer_id equal to 0 containing the value of sps_seq_parameter_set_id for the active SPS > RBSP for the base layer for a CVS shall have the same content as that of the active SPS RBSP for the base layer for the > CVS, unless it follows the last access unit of the CVS and precedes the first VCL NAL unit and the first SEI NAL unit > containing an active parameter sets SEI message (when present) of another CVS." > > "Any SPS NAL unit with any nuh_layer_id value containing the value of sps_seq_parameter_set_id for the active SPS > RBSP for a particular layer shall have the same content as that of the active SPS RBSP for the particular layer unless it > follows the access unit auA containing the last coded picture for which the active SPS RBSP for the particular layer is > required to be active for the particular layer and precedes the first NAL unit succeeding auA in decoding order that activates > an SPS RBSP with the same value of seq_parameter_set_id." I have no idea why you're quoting the spec at me, I know perfectly well the PPS cannot change between slices. My point is this: if the current check for PPS change does not detect it, it should be fixed. Specifically, it should compare actual PPS objects rather than pps_id. > So if anything fancy is wanted, the way to go is not to parse it in the first place. > Because if it matches then the parsing was a waste of time. If it mismatches, that > would be invalid and would just lead to failure anyway > > But really the primary goal is to fix the out of array access and be easy to > backport. I am not trying to fix this in a fancy way. > The simpler and more robust the fix is the better. This "simple and robust" approach of sprinkling random checks all over the place leads to unreadable and unmaintainable code. -- 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".