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 C7C32438EA for ; Sat, 2 Jul 2022 22:25:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 86D0168B945; Sun, 3 Jul 2022 01:25:54 +0300 (EEST) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2FCE068B926 for ; Sun, 3 Jul 2022 01:25:48 +0300 (EEST) Received: by mail-ot1-f46.google.com with SMTP id b23-20020a9d7557000000b00616c7999865so4706356otl.12 for ; Sat, 02 Jul 2022 15:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=rO5bVKBKgJMX3jd91k2pDWGvEtB7hq/6EJSzbSeX8RM=; b=ggeiNEMKevp7aRjTIrfpdgi4Nu3tLBbxxIx1NhMt3DNK+xqc8qTTwKQjbVfxJrG/2Z f50+MK/NoaalvN8UTPDSjqax5qZhq7YqRIM/aRoHXi773HJnWy4Je1HWp544BT1Wrgz0 0UgBG1LZAvyE/g36RHtFtPO+x7INICFa1ixTRruu7zOkHGg610eOpE0RBdtHctaCx4dX Ir2BYyupcV5ejx+Cm/sK9QQJFwIv4VHAFW1I+5NbycTcLnuX+grQFZE4zE7M9wyvQ/MU ep2pI60aE/2miY/oA+abTBFBRQwPyLy46auPiNNidLZef6xEPEV3LvI6SZzx5C51gN3+ 8tLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=rO5bVKBKgJMX3jd91k2pDWGvEtB7hq/6EJSzbSeX8RM=; b=puNHIERsi5FG8NyQcCMOd8gwgwsoTEvny+HdenydwF/VJOB4YAnQiSDu/qQN4JOad4 9iZTSjpOzh9jTaJz9pK7ug4xL9OwuCcaNXNx+1O29w48rBDhRvR/ZGeCaKK/JVXXrh9B DtZO95Sp6OcAnt89OtAL+oX1ke7iPrtRZeFHHAId55Mg9p1rWCYpxbdjFifJOqEFZ5vy RxBEUSByVXg+/CM7c8ZydWtj8hsc9w3+d84mch2aXKBhf6AtEOQSEs//mca4dK03F0wd vo5/XhfYonZcyVgTyQbO1mMSDjkx+p8kIxwVWlA3Mna2qfAQVyeaxUhsAIipcfjN2ENP Jg4Q== X-Gm-Message-State: AJIora+tjjMru2vKX9lh1QdRa8ZK+9IAEepUysqt5G0BJL3wNC9liSkX KepvJM/SAWuq9ubgkYY0YXPXOJDLJq8iYw== X-Google-Smtp-Source: AGRyM1th6syhU1AEufFC6iDy9Ham+OuLXch8IVkJikapgqcu0imJWACdPy+ve7gOS5PwUzlUBmGOoA== X-Received: by 2002:a05:6830:1cc2:b0:618:c8ca:3371 with SMTP id p2-20020a0568301cc200b00618c8ca3371mr4488285otg.260.1656800746089; Sat, 02 Jul 2022 15:25:46 -0700 (PDT) Received: from localhost.localdomain ([186.136.131.204]) by smtp.gmail.com with ESMTPSA id bl29-20020a056808309d00b0032ed2343100sm13269484oib.14.2022.07.02.15.25.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 15:25:44 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 2 Jul 2022 19:25:32 -0300 Message-Id: <20220702222532.9609-1-jamrial@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avutil/channel_layout: don't error out on truncated strings 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: The doxy for av_channel_layout_describe() states that the user should look at the return value to check if the string was truncated. Returning an error code in this scenario goes against this and is an API break. This is a better fix than the one committed in 8154cb7c2f for the timeout fuzzing issue. Signed-off-by: James Almer --- libavutil/channel_layout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c index 1887987789..d54a0adbe1 100644 --- a/libavutil/channel_layout.c +++ b/libavutil/channel_layout.c @@ -759,7 +759,7 @@ int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout, av_bprintf(bp, "@%s", channel_layout->u.map[i].name); if (!av_bprint_is_complete(bp)) - return AVERROR(ENOMEM); + break; } if (channel_layout->nb_channels) { -- 2.36.1 _______________________________________________ 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".