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 6E6DA4A18D for ; Sat, 23 Mar 2024 13:06:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1540968D530; Sat, 23 Mar 2024 15:06:26 +0200 (EET) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 69C3768D439 for ; Sat, 23 Mar 2024 15:06:19 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=cBRgi9y2; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id D5C814D42 for ; Sat, 23 Mar 2024 14:06:18 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 6HFIjondvUAE for ; Sat, 23 Mar 2024 14:06:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1711199176; bh=dxLR3JkenrE9QkWWyOvZUoLp0x2DXA1RSYFa4t/2sEQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cBRgi9y2vupkzYR+oJEgVRt/7m4dq8iZVkcGzqB7P02AwapPi5NYjCsai8bRqGmdC ZMeTig8df64ma68MiB3XV04UHfHHfOS2KkGT9N/W5be/YrQMjg0vgYgpP8RHQ4VP82 FHKf6PRmVyBT/tCu2G344vEL2EIA08nEAlrgxLs/0/ROxrdTrZiULmYQkE9CYZGXgF +kbmv1piNqF24mHhKBUjXPw3mOaLI/kOJzJB9pc8hjWkebYsKBbxRB5UZlEl4/7EpK M4IZksboO04dqx5peN+PFJqnTtcyK7a9jpPM3Y/lGAps9/h5ZuBjxN+v5gbPecFY+y AbM+tRQdNdjRg== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 9D40E4D4D for ; Sat, 23 Mar 2024 14:06:16 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 87F433A0A6B for ; Sat, 23 Mar 2024 14:06:16 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 23 Mar 2024 14:04:09 +0100 Message-ID: <20240323130409.20925-4-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240323130409.20925-1-anton@khirnov.net> References: <20240323130409.20925-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] fftools/ffmpeg_enc: simplify error handling for decoded_side_data setup 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: There is no need to free the already-added items, they will be freed alongside the codec context. There is also little point in an error message, as the only reason this can fail is malloc failure. --- fftools/ffmpeg_enc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 61310c67f1..9103fb74c0 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -198,15 +198,8 @@ int enc_open(void *opaque, const AVFrame *frame) &enc_ctx->nb_decoded_side_data, frame->side_data[i], AV_FRAME_SIDE_DATA_FLAG_UNIQUE); - if (ret < 0) { - av_frame_side_data_free( - &enc_ctx->decoded_side_data, - &enc_ctx->nb_decoded_side_data); - av_log(NULL, AV_LOG_ERROR, - "failed to configure video encoder: %s!\n", - av_err2str(ret)); + if (ret < 0) return ret; - } } } -- 2.43.0 _______________________________________________ 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".