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 8026B4C814 for ; Tue, 6 Aug 2024 18:05:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4C5BD68DA66; Tue, 6 Aug 2024 21:05:01 +0300 (EEST) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0843468D935 for ; Tue, 6 Aug 2024 21:04:55 +0300 (EEST) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1fd90c2fc68so9254635ad.1 for ; Tue, 06 Aug 2024 11:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722967492; x=1723572292; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=NR90BGqbOoQq1gTDyMwpJCEYIVthJ09le72tehpEy1w=; b=CXw6MFtVpNzvyFUDSuQr3Yr/XKBhkS2kndfidSioQDsoHxLWwaLRU/ZawbPrua31xS 9TTMUCZerlk7+hA88ZzIKtlp+jdaRqHZL4QssO4GxCPiq7Wvv/AEkE+CQAEnKH2MwTRf rxAYzHdxe8nMhnl5LjQq7MTEcD1/ULh2d4D4PqDLBNX8GwZ+B7QYwD9zhRD78Po6nWva FTeQDkGKX75UuvAoJbk+rtieTmSb0zrwqWABIFBEgCoGH9uEM2aJ6LxcjK17yfKsub2D rCdd7zhUeQ+P6/WX+4p68ngli2NssTiZX99nlynJBPXQOwCYq9aa82y29KhIXMn2vGYD 5ZEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722967492; x=1723572292; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NR90BGqbOoQq1gTDyMwpJCEYIVthJ09le72tehpEy1w=; b=tR1Yk8kYcNWEpiX2Eq/FEnI2Qa5nTzfnbthoD3lr0jvesGgWJquonCXy+N/jEBJaSz aWwcgHWbGqx12YZjl2xfabelzFgydT1j3nhV+u8mbC2Izu8HsbV+xQobZFRDOuN0exoS LGpYK5TTSSts2gn1TgdYGTEhi4ppxG+5s3iO923KPne8A2zM9ZpmBvBpZ0dawFBKXNZY iN6SLskbiw4zAx7JDVghGtXHhV+f1kU6H4L13NXACMCxoK+xp094XHWkxSXenoBtMnog 7CoHWWB+M7fcjSMCi6PY3zLV6/P5um5WO5dCjOIGR7tUaDNBfLvXllHSWCihu3qE1nLs p+7g== X-Gm-Message-State: AOJu0YyjOEYTnq7B5fjXGvxyR9wKUzVpa5tac7jA6vv+AkKr5togu4pB YrObXL5ZkQqqqV2YbbLT57WRsEl6htvXUZfeDEnVsXPHOx+XU3EeoWzFcg== X-Google-Smtp-Source: AGHT+IEtK2BZm0KtLUmQP6eRIOS06CV1ICmxGLXzrti7UJS3dDUCLferh/nEGppVHhgeFfPBYGyewA== X-Received: by 2002:a17:903:234e:b0:1f7:3d0d:4cd with SMTP id d9443c01a7336-1ff57292a32mr160115825ad.24.1722967491303; Tue, 06 Aug 2024 11:04:51 -0700 (PDT) Received: from [192.168.0.14] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20077164e0esm18979065ad.185.2024.08.06.11.04.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Aug 2024 11:04:50 -0700 (PDT) Message-ID: <640d9bb8-4ed6-4cbd-ba53-2ef7a36dc558@gmail.com> Date: Tue, 6 Aug 2024 15:04:54 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240806170538.GI4991@pb2> <20240806173823.GJ4991@pb2> Content-Language: en-US From: James Almer In-Reply-To: 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 8/6/2024 2:54 PM, 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 = (call); \ >>> if (err < 0) \ >>> return err; \ >>> } while (0) >>> >>> #define FUNC_NAME2(rw, codec, name) cbs_ ## codec ## _ ## rw ## _ ## name >>> #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 ? > > I don't think that this is really obfuscated. > >> >> the issue iam looking at is due to >> >> SEI_FUNC(sei_pic_timing, (CodedBitstreamContext *ctx, RWContext *rw, H264RawSEIPicTiming *current, SEIMessageState *sei)) >> >> 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 >> >> I cannot find any match for "cbs" in MAINTAINERS, also there are no copyright >> with names in the cbs code. > > 1. I just sent a patch that "fixes" this. > 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 Is this a scenario where a slice that referenced an SPS was parsed, then a SEI message, then another slice that references another SPS, and the SEI expects the latter to be active despite it being coded before the slice? > more so with spec-incompliant input, which is presumably what the fuzzer > produced). > > - Andreas > > _______________________________________________ > 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". _______________________________________________ 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".