From patchwork Wed Nov 9 16:34:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 39240 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp413450pzb; Wed, 9 Nov 2022 08:35:07 -0800 (PST) X-Google-Smtp-Source: AMsMyM5/611M3/RPjv2XzVykArTDBnInZymAlsUDsgaw/3k+dOM1Sj4MELamDj/lxubNnDWIILXH X-Received: by 2002:a17:906:5fd5:b0:7ae:3565:49ff with SMTP id k21-20020a1709065fd500b007ae356549ffmr1190603ejv.741.1668011706848; Wed, 09 Nov 2022 08:35:06 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i6-20020a170906250600b0078d2a84f2f8si11847345ejb.645.2022.11.09.08.35.05; Wed, 09 Nov 2022 08:35:06 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b="ND2Uo/uS"; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D6EF468B909; Wed, 9 Nov 2022 18:35:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074025.outbound.protection.outlook.com [40.92.74.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3BE6568B176 for ; Wed, 9 Nov 2022 18:34:55 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DkbQrWstL/hGb7mysrqE/hmVGlFSSjLamn050VYXAX8HaN4gqqfiJ+cva2Jej+2n/uDvacPX1qojELbgKgiwqVvQ584Oi7Gn7KTXPV28LufHDcd8RvtHYDx+p8KNJZQJ6wLbSdiHfoEbRe1jyJ3JMrR5zTfFZZ8xfkW2uLBnQ48F9qKahnxHbtlD7plzDIvvXVfSOIq3LQSnOeqLOY1tanMllppLCxrg+4fas0QqAKbYZCeC6yp+B7+JSD0yH/sSk6Juqv07UBzvliJjaN8WhbDm+PQPpwvv6gfmfsBDnWt1PGlydgNd9lrJ5Jyx7GHKVEBj0IlVvTwE5YHqBOFLDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=6KqFzaaQz2Lii/lx2BG/imtg4ekbd5omge28icahN6g=; b=Hha9QXzNh7ls3/SGl8D7xeeTQcsHpcviaTRDthm6ctAD9Ca0CljXvslxeYZN2X+UbxjxrsZ2X5yF/PMdVdmDM2kOmvqrZN4wyFJouSskolVI6EoWyToupJo0PcrzOJMxW/b0rHwkPDKZE9B2MkuMH1U4AFCklbZEXNKXH4WEeJWBr39vOnE6EboGVlLyIXgjvDKpEA8AHU+aM7Y8Kzv/4+kDzJVP0IgD9xKfElfwd61VSRnVrXy5aqH3dbfOd6KEIrHAneEjNwtU5Bg8clUnSqbazVi3eEMRZ2cT/ILsxpReNrrnITBp67GhV7DQFMHFkH9EmIe5TMBJI15xnot/Rw== 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=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6KqFzaaQz2Lii/lx2BG/imtg4ekbd5omge28icahN6g=; b=ND2Uo/uSmNi1IXeNHdIaw2wGIEoNrUSSCNTFwISbP99odK8ZuhfcHZrF/jH1521arKR1dMEdTt1qQhHazwe/sfK0JYmcbFaEjIsMtLLBep6hQRJSBwhit+LFy5oLdrx3yJsYjDW0IsOh2pxfmOlvgPzzoiJCLirwr9CTBZFk0X5xVXFvgfDXh8BwHa1/2TQ/CwJAsSgygI6zJjasyUHpyrUAsiEhjVbqjf3NLCcnNNHpud8wc6uZdO/a+6wnD58m/1igh1H1CCwJZr9i4OFHgyBwLdqY3ugGvXW/7K/aYNHpH7Y5ZNsBZLLzVyQwGPHcumXQCEsrsgsNx3r1tIba0g== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0205.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:276::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Wed, 9 Nov 2022 16:34:53 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::9587:72b8:e3ec:c4fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::9587:72b8:e3ec:c4fe%6]) with mapi id 15.20.5791.027; Wed, 9 Nov 2022 16:34:53 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 9 Nov 2022 17:34:58 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [bsuuBOAapjdqD2GVI8qvXthEFYUOcdJ7w595Nf0+2rQ=] X-ClientProxiedBy: AS9PR06CA0266.eurprd06.prod.outlook.com (2603:10a6:20b:45f::15) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221109163501.344932-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0205:EE_ X-MS-Office365-Filtering-Correlation-Id: f039252e-d742-4190-eae4-08dac2705402 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqNWn9S1x2PUOFdlA6Fd+ZoGyeHM1t/M0/m+9Zcxy3qJLFWByLFsR6zyAK3qDtrbVqaJ7wr4+fi56k4g6lu1KHvMwv5NATxwSW7Kq3Ud5SBbb7hw+jxRSc9HzyuvvDhIRlfwgixSyctCvI4sHK4//FuKz1VqKbqI2qxXs4RakHYB8ir8yUEBPd1zuPbf6Wf6to20qpFwWVCSbSAKhIBjnHa69WrRtOlQ9WEyCwPL49kD10BvLU5CaKqGcFODg8oHP7yy6scdU+5RDCjI9RAhomIgLTZPILKh/qA++ZWZhj86aMeFeH3ZDZBVuJ5C3zjklyohLJ9y9Pj7Qn8ovvKm7qXgm3opQSzmsOfxZeX72gBwIXCWq9sEK58eZIewI1UG3QiPgEIPnkJAK2BNQ/xzUjuJ+3gVLvz175eU1lbV8G0wm3B/kjnZldkcGtDAMvpRQfdx4bl4oJUx5KD5U/Qn4Jy+wy1b1ZLs2KO/KlGvmVVQf7nIVGcOZgv12/D1cg5WwUNw8pZuWkY/VBE5wgwDkNKS536H+mTIsQf3rwsEb0ixk0Pv/nLJOFajJugL+S4Ijw2RoNMJhCpffxeQe/4E4yimacmN4IpxvnXgL42xMi1mF4Y3b0SwFAIbyG3WP0LGWe5JjG+suVaR9Od6Kem3opmhtVqyCil7XTzUmHI3QY34BcquffQXensP1I2vQrgNBmTSoq1FwVgoePSl0AFnbLBpdGw1R5YWxe3gzXtLhApPc2438X8/lXMfn8nPSIQuHI= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tR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-4190-eae4-08dac2705402 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2022 16:34:53.0605 (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: DU2P250MB0205 Subject: [FFmpeg-devel] [PATCH 1/4] avfilter/af_surround: Check return value of av_tx_init() 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: L8J/L8Xpj9rS Should fix Coverity issue #1516766. Signed-off-by: Andreas Rheinhardt --- libavfilter/af_surround.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c index 858fed609a..969325cf6b 100644 --- a/libavfilter/af_surround.c +++ b/libavfilter/af_surround.c @@ -194,7 +194,7 @@ static int config_input(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; AudioSurroundContext *s = ctx->priv; - int ch; + int ch, err; s->rdft = av_calloc(inlink->ch_layout.nb_channels, sizeof(*s->rdft)); if (!s->rdft) @@ -204,9 +204,10 @@ static int config_input(AVFilterLink *inlink) for (ch = 0; ch < inlink->ch_layout.nb_channels; ch++) { float scale = 1.f; - av_tx_init(&s->rdft[ch], &s->tx_fn, AV_TX_FLOAT_RDFT, 0, s->buf_size, &scale, 0); - if (!s->rdft[ch]) - return AVERROR(ENOMEM); + err = av_tx_init(&s->rdft[ch], &s->tx_fn, AV_TX_FLOAT_RDFT, + 0, s->buf_size, &scale, 0); + if (err < 0) + return err; } s->input_levels = av_malloc_array(s->nb_in_channels, sizeof(*s->input_levels)); if (!s->input_levels) @@ -263,7 +264,7 @@ static int config_output(AVFilterLink *outlink) { AVFilterContext *ctx = outlink->src; AudioSurroundContext *s = ctx->priv; - int ch; + int ch, err; s->irdft = av_calloc(outlink->ch_layout.nb_channels, sizeof(*s->irdft)); if (!s->irdft) @@ -273,9 +274,10 @@ static int config_output(AVFilterLink *outlink) for (ch = 0; ch < outlink->ch_layout.nb_channels; ch++) { float iscale = 1.f; - av_tx_init(&s->irdft[ch], &s->itx_fn, AV_TX_FLOAT_RDFT, 1, s->buf_size, &iscale, 0); - if (!s->irdft[ch]) - return AVERROR(ENOMEM); + err = av_tx_init(&s->irdft[ch], &s->itx_fn, AV_TX_FLOAT_RDFT, + 1, s->buf_size, &iscale, 0); + if (err < 0) + return err; } s->output_levels = av_malloc_array(s->nb_out_channels, sizeof(*s->output_levels)); if (!s->output_levels)