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 B46BA4E922 for ; Thu, 12 Jun 2025 11:34:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id F1BF968C02C; Thu, 12 Jun 2025 14:34:10 +0300 (EEST) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 932CA68B23A for ; Thu, 12 Jun 2025 14:34:04 +0300 (EEST) Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-3a4f71831abso777328f8f.3 for ; Thu, 12 Jun 2025 04:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749728044; x=1750332844; darn=ffmpeg.org; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :from:to:cc:subject:date:message-id:reply-to; bh=W/kuyIjZC8G3GkZvZyN6yNHZyBd2cg1S1v9NlsRIu9k=; b=Rxvh1vAuzl1yR1SxgwDkmnjVznFg8x9bEtvsEiMRwaTqNObC1YqWZObtaalNjiF+vp IVK64J9XLLmbNQRKKEEZj2zL55b2v5E0L8O4Cg20dfmdZ5WapPXdC1QnYZRZYDwNcSkF wHmdEV0R3Pn2IzdZvpKpE1kenVpCtBMS5VkSdMc+CCyZuk7yKDLidKMPiX5JUSVmlI6N Rl7e8Nm0Kcs8jeF/2kiEmxKxNC2il+L1eWR4C/oPQdZYDTDegeIfLyDcagz2JYyc6M+m i1fYx0ttJcsudpUaltApr5DNnJuKoVTpLNdgycRWBHh8LArKtaYEpeQu86qXHJFS8kuS W5dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749728044; x=1750332844; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=W/kuyIjZC8G3GkZvZyN6yNHZyBd2cg1S1v9NlsRIu9k=; b=waYBkm2tEZyMA5yJDY8Y7Fw+tsb/SZioI3AkfyT7MEB8E2AplFZA/44lj6+9Ft4sA+ EOvAIUk8XeYjr1JvzI6vLqehoD6g9kYOCV4rUh7flNllcEdDe0e1HrcSwsvHsDhmct8p vE3XKv56t6dNw18ukkEQK3uUR+AggGGKsdGYwMfwb1KzS3V7d3E295Q628SaZNZpjVsc Y4MpEdNjrEr853hsAPBEJ9eDx1rKXUKwUwrm9g0f409cIqv0/eadZINskA8nWCI5Nmgd XshKNuTopq5YTtx3uiobqM+Z4gjTtEhkbiKvHPqeISmdoR82uU9RggDEbQOzxdoHgnrt S73A== X-Gm-Message-State: AOJu0YzS4fb3o+2XyMnIxl0Dr5Fy//jOzlM5reJR5bvkmba52Rdq7W2B U4Cq3CGIF8fzH0VwHiddj2nGPQke6Av8Lz1EPkzYkxTgCQPv3EUvKSL6JYWgiw== X-Gm-Gg: ASbGnctsFsbH80YJfqMn+CBcihH1bmNgxWTeNVhA67upBC019fCGb9YFUsOdzNbWYkQ MdynFyvcZybVZqI+u0ASiiqTmzmvZ9822V/caOudcsPx8PNPMp9NBjt5pT3HV3zaam0FciddwhJ k3wobYq0z6GhbTZ00IwotfHOqZD5jiHAJiyEd1OwqCvs+XyuzJciW581SzmtTh8i8rRlhrhVA6+ +kE3bg6CFBTV8hlFU1S0ETyT8KaYWsgj3y60O7/W9M4r7oB+mka/0Xtso8h7rJz74siWFtOhPwz y/CCN/6KPSQngh59B1/uHBeZDxHOKz9pyqHh4epDzlc0XUEd7GZ5eXWETlqvE3OKiqRNydAyIdt 0qCdGp13LaTt9soVvcSqzH6OEtBtkanUcQoeQpj9imz0HJx3lHvedEB2XFV1BesSBKfxk2ITLeA Y= X-Google-Smtp-Source: AGHT+IF1xxhtuxdJ4QJVSNVspTHWiCnMzV99PJZ1AzCcAQHbUqiByhfnrFSF2A94L5/I1xWi/V4cBw== X-Received: by 2002:a5d:588d:0:b0:3a4:e1e1:7779 with SMTP id ffacd0b85a97d-3a5607c9b78mr2592851f8f.32.1749728043691; Thu, 12 Jun 2025 04:34:03 -0700 (PDT) Received: from [192.168.178.57] (p200301023700450060f2a9d7350ce887.dip0.t-ipconnect.de. [2003:102:3700:4500:60f2:a9d7:350c:e887]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a561a3c538sm1748788f8f.50.2025.06.12.04.34.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jun 2025 04:34:03 -0700 (PDT) From: Marvin Scholz To: FFmpeg development discussions and patches Date: Thu, 12 Jun 2025 13:34:02 +0200 X-Mailer: MailMate (2.0r6222) Message-ID: <176A57A6-3641-4C87-B427-BA6091EBB464@gmail.com> In-Reply-To: References: <20250611195725.95154-1-epirat07@gmail.com> <20250611195725.95154-3-epirat07@gmail.com> MIME-Version: 1.0 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: 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. > 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". _______________________________________________ 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".