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 29F9B4C220 for ; Tue, 23 Jul 2024 13:16:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BABD468D51E; Tue, 23 Jul 2024 16:16:23 +0300 (EEST) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E0BAE68CC25 for ; Tue, 23 Jul 2024 16:16:16 +0300 (EEST) 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=Fepf1RBp; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id B00CF4DDB for ; Tue, 23 Jul 2024 15:16:14 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id s8zfrgPvTjJZ for ; Tue, 23 Jul 2024 15:16:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1721740573; bh=U1kx6eQ0jTAz7UwSxFv42LNHUoolUutGG/D561k5Rgs=; h=From:To:Subject:Date:From; b=Fepf1RBp6he5nQ8RHBNyb1DauC+lq6maILnl7b335rIDYDnQEaSKqnmZLaOumAmDc EIKNNAHcGOWpjXj5bWDQlCM6VmRMcee4dU4q9yhWI2qxFhxooRo2gbSHtK+hyhsP8X K/e36mMFBvu7FhLGA2FysSFumJUyyRogiRI9kdFCqt6xhqibFxbBZ9DU7qmK3y13sq jCnwsIjLS+IHT93tf7jzJDbVCGoJCaodAAq80lZEoPjZfFAwXcdOO2c9QFqJs6IBVQ Nd+TGKVegKKF7XNRouJHDVHbNDLWfkSKXyP1JXmBUWT/QQv2JH1lXX7Q6ilRsQAY8H bU64FTEWLGvGw== 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 B26CA998 for ; Tue, 23 Jul 2024 15:16:13 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 7B3C23A02B4 for ; Tue, 23 Jul 2024 15:16:07 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 23 Jul 2024 15:16:06 +0200 Message-ID: <20240723131606.13307-1-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg: prefer real errors over EOF in err_merge() 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 an issue in 6.1 when reading a corrupted file with -xerror would exit with success. This specific issue is not present in master, but this should generally be a more robust behaviour. Reported-by: Andrej Peterka --- fftools/ffmpeg_utils.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg_utils.h b/fftools/ffmpeg_utils.h index bd225abc38..7939e44cdc 100644 --- a/fftools/ffmpeg_utils.h +++ b/fftools/ffmpeg_utils.h @@ -35,11 +35,12 @@ typedef struct Timestamp { /** * Merge two return codes - return one of the error codes if at least one of * them was negative, 0 otherwise. - * Currently just picks the first one, eventually we might want to do something - * more sophisticated, like sorting them by priority. */ static inline int err_merge(int err0, int err1) { + // prefer "real" errors over EOF + if ((err0 >= 0 || err0 == AVERROR_EOF) && err1 < 0) + return err1; return (err0 < 0) ? err0 : FFMIN(err1, 0); } -- 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".