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 731F949E11 for ; Thu, 11 Jul 2024 23:34:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2DAE868DB52; Fri, 12 Jul 2024 02:34:28 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CB5CD68DB2F for ; Fri, 12 Jul 2024 02:34:20 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 0E4DE1BF203 for ; Thu, 11 Jul 2024 23:34:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720740860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kiOJvUtuW2YP7YvBXFQto7R4wp/6l0thhQBdUvZRUsY=; b=cTTxoXo+6iOYd36CrU1vW2GCjKwfzSTdgZ2QVJy4EDosfQ0gDkrK/EP5ITbSuqup/UxFsr Pvewn8oJn9reN5rfvBNWn6M9yQkXfnXO/hbjOM/bqUe4lis/IKZyIewfBhN59XjLHRhpkf m4FreZehYjvXqcC1WD46ISMbXFm8zpNfejSINH65enxS/o+hCgVcVkkzIw0rZhKGqNqfWj H7Mqvzeiu56BWZKjto9MwlP1Gdm8BVTIEfE5jQa6JFMUtBhzq8eXTN31ttqbVAeer32JB1 X6Dwv+BH9JvqYdUoEO17twZr2PDg7gKZe6PTyCQcfoi5g6OGkaR5aFb1/FYAyg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 12 Jul 2024 01:33:57 +0200 Message-ID: <20240711233417.1896879-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711233417.1896879-1-michael@niedermayer.cc> References: <20240711233417.1896879-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 03/22] avformat/hlsenc: Check ret 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: Fixes: CID1609624 Unused value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavformat/hlsenc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 274de00f9a9..6d6ede1b6ff 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2617,8 +2617,10 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) " will retry with a new http session.\n"); ff_format_io_close(s, &vs->out); ret = hlsenc_io_open(s, &vs->out, filename, &options); - reflush_dynbuf(vs, &range_length); - ret = hlsenc_io_close(s, &vs->out, filename); + if (ret >= 0) { + reflush_dynbuf(vs, &range_length); + ret = hlsenc_io_close(s, &vs->out, filename); + } } av_dict_free(&options); av_freep(&vs->temp_buffer); @@ -2629,6 +2631,9 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) hls_rename_temp_file(s, oc); } + if (ret < 0) + return ret; + old_filename = av_strdup(oc->url); if (!old_filename) { return AVERROR(ENOMEM); -- 2.45.2 _______________________________________________ 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".