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 874DA4C81F for ; Tue, 6 Aug 2024 18:13:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1B46168DA6C; Tue, 6 Aug 2024 21:13:03 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CC3A368DA5B for ; Tue, 6 Aug 2024 21:12:55 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 01897C0003 for ; Tue, 6 Aug 2024 18:12:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1722967975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TnAt0RNa7HR0rs9rWhPIm5FddBe0VCqAIyFhsNbpNcY=; b=nZMGkdzpH8jEircIDETPOzFQHoehtnF6k0XUpAbU+d3A5sFsa729tcmcSvUX9e4ADOckPd B7yirn4aOfkz7aGQ4Eak8PEEz7+rUIRjeMufybj6FQjYsyNUDVqCn59eAQW2oF4hQ7oXVe 7HdI2WwdLecTYk+UoC7PqWPqfrHCTLal7LdxTZLkvYjqu7TNJ4TpZGJtvswEkpbSo43/qh DSRx/efwLPmwAZ743EjVVXt8X8md7d9fyNZaZKNCel2Q4+i5q2KYN70SI5HjZv23XorvPF OCHVDQsvvl1N0T+HZeTaTZTdsmgZFR6UfMCsy6KEqMICCwM/KxEOg+tEn+JtSw== Date: Tue, 6 Aug 2024 20:12:53 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240806181253.GK4991@pb2> References: <20240806170538.GI4991@pb2> <20240806173823.GJ4991@pb2> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] CBS 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: multipart/mixed; boundary="===============7498485786001814935==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7498485786001814935== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="t+aXE7hLC8APFkG0" Content-Disposition: inline --t+aXE7hLC8APFkG0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 06, 2024 at 07:54:58PM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > On Tue, Aug 06, 2024 at 07:05:38PM +0200, Michael Niedermayer wrote: > >> Hi > >> > >> Did CBS win the obfuscated C contest yet? > >> > >> I was just looking at a msan issue and then looked at this: > >> > >> CHECK(FUNC_SEI(message_list)(ctx, rw, ¤t->message_list, 1)); > >> > >> > >> #define CHECK(call) do { \ > >> err =3D (call); \ > >> if (err < 0) \ > >> return err; \ > >> } while (0) > >> > >> #define FUNC_NAME2(rw, codec, name) cbs_ ## codec ## _ ## rw ## _ ## n= ame > >> #define FUNC_NAME1(rw, codec, name) FUNC_NAME2(rw, codec, name) > >> #define FUNC_H264(name) FUNC_NAME1(READWRITE, h264, name) > >> #define FUNC_H265(name) FUNC_NAME1(READWRITE, h265, name) > >> #define FUNC_H266(name) FUNC_NAME1(READWRITE, h266, name) > >> #define FUNC_SEI(name) FUNC_NAME1(READWRITE, sei, name) > >> > >> #define SEI_FUNC(name, args) \ > >> static int FUNC(name) args; \ > >> static int FUNC(name ## _internal)(CodedBitstreamContext *ctx, \ > >> RWContext *rw, void *cur, \ > >> SEIMessageState *state) \ > >> { \ > >> return FUNC(name)(ctx, rw, cur, state); \ > >> } \ > >> static int FUNC(name) args > >> > >> > >> anyway, can we remove all preprocessor use from cbs ? >=20 > I don't think that this is really obfuscated. Then you qualify as maintainer for this code. Thanks! >=20 > >=20 > > the issue iam looking at is due to > >=20 > > SEI_FUNC(sei_pic_timing, (CodedBitstreamContext *ctx, RWContext *rw, H2= 64RawSEIPicTiming *current, SEIMessageState *sei)) > >=20 > > having different active SPS on writing than reading, so the write code > > has nal_hrd_parameters_present_flag set while the read had that 0 > > so uninitialized data is written > >=20 > > I cannot find any match for "cbs" in MAINTAINERS, also there are no cop= yright > > with names in the cbs code. >=20 > 1. I just sent a patch that "fixes" this. Thats what i came up with too (and it works). Given we both hit that, please apply > 2. But actually, there is a deeper bug here: We would need to defer > parsing certain SEI message units to a second pass when the currently > active SPS is known. This can happen with spec-compliant input (and even > more so with spec-incompliant input, which is presumably what the fuzzer > produced). Thats a deeper analysis than what i did. I stoped at the "just clear it, as= in 1." and then was looking for someone who would implement the correct fix Ill send you the input sample privately Thanks alot! [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- Aristotle=20 --t+aXE7hLC8APFkG0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZrJnogAKCRBhHseHBAsP q6rTAKCa31GSfbsgZ1SaX1L1v4cl5WW5/QCfRjbuT+UVmKeA3PmgeYa8GefJ2SI= =t+CE -----END PGP SIGNATURE----- --t+aXE7hLC8APFkG0-- --===============7498485786001814935== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============7498485786001814935==--