From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 27D774E994 for ; Thu, 12 Jun 2025 16:40:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 6807868C2F1; Thu, 12 Jun 2025 19:40:12 +0300 (EEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10olkn2035.outbound.protection.outlook.com [40.92.41.35]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 103EC68BECB for ; Thu, 12 Jun 2025 19:40:05 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rrfl4FwW3Z3Ud7Gstqg3EMpP8nV0tMddWzy5Ztu/OcdSAYZuCuUCc/0ctowAnRDRGoHCHB+y84E6w20zOicXEdGoJITn/BZzGZ829F/Zfh3dbKY4mbqvGsv7LozCEmdY6XCZwojBLcQScmsGyymDEeViDWGrtzOYWULDgohvsn++PpjtyALH2WW3s+WWQ+Nw29V6h4eFOohybHZMg2GXk+AzulxvEQo4xICQSNZ9h3g61wGMAJZZaizV4uhAL4FcDm0XD2L/l/Dacz5i4SqWBZyHXD8pSD5lm/874jQJ+qWFkARae7Tp9iB9yf6/ficH5BgIfaYq3fAsc5UGXkkOww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BcHJ1pPxLl6UUTDKb1Ezlnfb+fySMZEsq+JwuWJzYHU=; b=X0JWhG7DI0+HptZiIC/24Z51VpBQnlPKyF3KYDzzF0ndMARSFdLIzkExxCSNUsCPn6KjyIHMOJT1k84DshKDnUf1/TaHIrV9ysCwJEvX/Co0smQOjRtvCEo+HowMCu6xeb1ysi6dQWxAmRu/8JoKbmCSQl32jT2Bng9+DjQO/lHTr1EvsiPftqEia35GW1wHgpOrNAMUKS06vu1HLpFTLdwzjUC8EKmO3qCANpcWlAeU+RRtBe8uHfuVgCvoQxXisNR0U6y1vb9lU0qaTMk/jh2c5WEvZAQujvKjBULElTDibpjkAhn/JzTUbMaXQUMsIMCXCBZXxB/XqRoN76E4IA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BcHJ1pPxLl6UUTDKb1Ezlnfb+fySMZEsq+JwuWJzYHU=; b=iEgUx/JZ+dyr3nE9Wna7h4zl9J3abNkwGdJQuunFn7dM+foZxFjHzx6iTNGkw6Q90o5kQav1DzBqg3ltEcq8TvIuS7w5h5OCKppTJAkLiq52JpyXOTcUtUIpScdjhj1C7cxlYNtNBPWHIFLzcQibWuIRAJ5NKGSiz6UXOZDuP6oELmTRgxozUDgf90M/QTSGsNwvqvIn3a28mYKCDMhNw8TsqzAh0jYmkBPTOLF4rcwRxREWx9+a4FUphJ1AVsh+SruoShOgHfDpSIBtadl7C7v6kD2EbIynKRVdFViOopyTLg60mrWKD2djb62amqjhfcz9rmcN1iRazLcLw3uh4g== Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:b::20) by DM8P223MB0253.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8835.18; Thu, 12 Jun 2025 16:40:02 +0000 Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::bf09:8e9:b07f:98a7]) by DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::bf09:8e9:b07f:98a7%6]) with mapi id 15.20.8835.023; Thu, 12 Jun 2025 16:40:02 +0000 From: "softworkz ." To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [PATCH 3/4] fftools/textformat: infer type in mermaid_print_value Thread-Index: AQHb2wspBx7ZczfmwUqwLxw3x1o//7P+yhzwgACbmACAAFAgoA== Date: Thu, 12 Jun 2025 16:40:02 +0000 Message-ID: References: <20250611195725.95154-1-epirat07@gmail.com> <20250611195725.95154-3-epirat07@gmail.com> <176A57A6-3641-4C87-B427-BA6091EBB464@gmail.com> In-Reply-To: <176A57A6-3641-4C87-B427-BA6091EBB464@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM8P223MB0365:EE_|DM8P223MB0253:EE_ x-ms-office365-filtering-correlation-id: 896b8a09-c189-4653-4371-08dda9cfc72c x-microsoft-antispam: BCL:0; ARA:14566002|15080799009|7092599006|8060799009|8062599006|461199028|41001999006|19110799006|3412199025|440099028|40105399003|102099032; x-microsoft-antispam-message-info: =?us-ascii?Q?8NcWnYX5X+lu5kyCmf9ZGBwqIxMH2IJ/TIToyMvb5X5nC6QaboXjdvxjx7iH?= =?us-ascii?Q?nEyheCDA8oXcuKRLBqTUEtZpowsnb7fQr5oSrn077IVkZl1FEYf1pd/sJ+91?= =?us-ascii?Q?Jfrs5N63meo933oBz9FDpAFR2IENH0LIRHkgZ4NgIxD0vFI+bb+0AwwNrxS5?= =?us-ascii?Q?AbMxi3eAZIBzkjeKdz9myUnp5WQEt7K9PVhFV1mxamhwwVMwJ0GSEEwJe+Nb?= =?us-ascii?Q?xFii+TU0sTaNkUcDThPKqGk4BWLWq6DaOKEQm8SU5RYoJdWeZd5/3657VfzX?= =?us-ascii?Q?Gr7o1PJ/om63bNrH135xMtOIezHD+6m9dCiF4KMRfBEGF48jSellFreubsmd?= =?us-ascii?Q?7UjwZuZxTL9cxPbgz93JFY0aNuNpXpocquHY1jnxbJo9g5rz3ReRHjo99aKA?= =?us-ascii?Q?fGBnzt7f8pn3mI/I/TkrE9SpOul3qYEPK2ZnPET3WN3nZ5saZSurg/wUZSOy?= =?us-ascii?Q?pbq7jLUwu7zgPYq6hEM3+01G3RLkBg588BpAiDYuGFbFippgVJMovR1Cqp8o?= =?us-ascii?Q?DnFLDo1yNvqKV2WHch+drrpaXelfuk55Mt+E20x7ei3wspXfsfJGNnI44COe?= =?us-ascii?Q?2KUOGxtjsOnpWGjzfLKQIqKpT+qOKb8iocUwX00kAX2ABysgLZ6fiAqUq4Wv?= =?us-ascii?Q?170yztBpXcHMSRFTOqIpiLR8zvK0hfTasCIvN+Ma+VkIwekGgjG9WtQuqWyu?= =?us-ascii?Q?2/uIeC/xUHCG824sxj1sKyidPnmuT+6TDqjk9MjD0LVwl+YkghtRGO+t1mdj?= =?us-ascii?Q?F0aGdfW86LXALz3IW4sQ/Y2BNHT6w94icb9CHRRTaB1uHbpmcMoXYqnar9wZ?= =?us-ascii?Q?USKLjpKmDVy4pwC4z1sdGcGE4PBaiNTf7OXWsQ3DRVZ3Ojr9h3CMvqCBc1JL?= =?us-ascii?Q?RirmAVnTglHWFh9HrtMWGJGEWDvjxkmafbjXJ0Ye6HpsABWITKSuHbNQBu38?= =?us-ascii?Q?CtmQOOntyPP3R14nbQGCY4T5Q9pxlXchhhYHi/zenSeFmOTuCXSUBLpDVeXe?= =?us-ascii?Q?4ccj7N3ehRcEpfD8u+t9SmH0k6EpjcIN7C5hxakIJQxbolVYLQieqfzLAaYB?= =?us-ascii?Q?18nxwOKXUk5AKCH1IqsEvcOIOHaKsD4D7QpKsWWsY5ysHZYpvutcS58lT+4p?= =?us-ascii?Q?a7WBbpNjaP6wSatI+DlRv13kEMa+O9fuwEBs4xDqgXcL2JoJhnnGp2U=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antisp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s+Qc544bISz2MaD8hQ0oM+GrKpqHs9ek4cDhPLs3ZSMGeLEce?= =?us-ascii?Q?6GY7WzB6qwfpIwlEVDNnDi4zfkin8o7yUG7nubSre+UgbC8Tk2lHgZb+4gYR?= =?us-ascii?Q?PP6X2d5W59QjQ7qmPFAGuMAOaJ7GhBxjJ0qICsCtZpqlbw4DOU24J3MSlwue?= =?us-ascii?Q?DJhO2lhCi002NqIEqk7c111JLa3rQdDXukfCq/EsAQ3vLsi0/PKwpqOABItC?= =?us-ascii?Q?BMq3yhE3Z+Fu5Es8GPTfW+lpdR5aqJveYu44yZbjat+KxkZ6/1Q/Z0C5Y7U2?= =?us-ascii?Q?M6lVOWny1F4RP6UbDGOrCMvuZ4KuIEptROzFRMTYh9eYtBha6QGmKu7ulAN2?= =?us-ascii?Q?pwOTY8s6XIGwwBznEh2T3YNFCygEL/B5PIJcTTlE1J62WFrWUTZGw38FqFI?= =?us-ascii?Q?=3D?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-8534-20-msonline-outlook-c7cf3.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 896b8a09-c189-4653-4371-08dda9cfc72c X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jun 2025 16:40:02.0644 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8P223MB0253 Subject: Re: [FFmpeg-devel] [PATCH 3/4] fftools/textformat: infer type in mermaid_print_value 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: > -----Original Message----- > From: ffmpeg-devel On Behalf Of > Marvin Scholz > Sent: Donnerstag, 12. Juni 2025 13:34 > To: FFmpeg development discussions and patches devel@ffmpeg.org> > Subject: Re: [FFmpeg-devel] [PATCH 3/4] fftools/textformat: infer > type in mermaid_print_value > > > > On 12 Jun 2025, at 4:19, softworkz . wrote: > > > Hi Marvin, > > > >> -----Original Message----- > >> From: ffmpeg-devel On Behalf > Of > >> Marvin Scholz > >> Sent: Mittwoch, 11. Juni 2025 21:57 > >> To: ffmpeg-devel@ffmpeg.org > >> Subject: [FFmpeg-devel] [PATCH 3/4] fftools/textformat: infer > type in > >> mermaid_print_value > >> > >> Instead of the caller having to indicate if it is passing an > >> integer, just use the fact that str is NULL when an integer is > >> to be printed. > >> --- > >> fftools/textformat/tf_mermaid.c | 12 ++++++------ > >> 1 file changed, 6 insertions(+), 6 deletions(-) > >> > >> diff --git a/fftools/textformat/tf_mermaid.c > >> b/fftools/textformat/tf_mermaid.c > >> index dbe489a7a7..da371c8fff 100644 > >> --- a/fftools/textformat/tf_mermaid.c > >> +++ b/fftools/textformat/tf_mermaid.c > >> @@ -547,7 +547,7 @@ static void > >> mermaid_print_section_footer(AVTextFormatContext *tfc) > >> } > >> > >> static void mermaid_print_value(AVTextFormatContext *tfc, const > char > >> *key, > >> - const char *str, int64_t num, > const > >> int is_int) > >> + const char *str, int64_t num) > >> { > >> MermaidContext *mmc = tfc->priv; > >> const AVTextFormatSection *section = tf_get_section(tfc, > tfc- > >>> level); > >> @@ -587,7 +587,7 @@ static void > >> mermaid_print_value(AVTextFormatContext *tfc, const char *key, > >> switch (mmc->diagram_config->diagram_type) { > >> case AV_DIAGRAMTYPE_GRAPH: > >> > >> - if (is_int) { > >> + if (!str) { > > > > This is not right - it would print 0 when the str is NULL. > > See tf_xml, it uses the same pattern (is_int). > > > > So what do you expect to happen when it is NULL? > > From what I have seen passing NULL for str would > make these functions actually UB as passing NULL > for a string to printf like functions is not defined, > unless I missed this being handled explicitly somewhere. Hi Marvin, you are surely right to point at this. There is still an ongoing discussion about parameter validation (with Stefano Sabatini) and I have a patchset for it that isn't submitted yet. This adds parameter validation in several ways and to several functions. For example, for the corresponding function in tf_xml.c, it adds this to the function at the start: static void xml_print_value(AVTextFormatContext *wctx, const char *key, const char *str, int64_t num, const int is_int) { AVBPrint buf; XMLContext *xml = wctx->priv; const struct AVTextFormatSection *section = tf_get_section(wctx, wctx->level); if (!section) return; if (!tf_validate_string_param(key, "key", wctx) || (!is_int && !tf_validate_string_param(str, "value", wctx))) { return; } .... This kind of "plot hole" has existed ever since in the original code. The merged patchset was about generalizing and refactoring code but not about making functional changes to the APIs. I made a cut at this point to avoid the patchset to become even more excessive. I will submit the next step about parameter validation in a while, when I find some time to revisit this topic. Thanks, sw _______________________________________________ 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".