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 76CA14235E for ; Mon, 14 Mar 2022 21:06:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 301E368B101; Mon, 14 Mar 2022 23:06:20 +0200 (EET) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B7F4068B0BE for ; Mon, 14 Mar 2022 23:06:13 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 15C24E67D9; Mon, 14 Mar 2022 22:06:14 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sSs4zAeRcJuB; Mon, 14 Mar 2022 22:06:12 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id B59A1E67E4; Mon, 14 Mar 2022 22:06:12 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 14 Mar 2022 22:06:02 +0100 Message-Id: <20220314210603.23870-3-cus@passwd.hu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220314210603.23870-1-cus@passwd.hu> References: <20220314210603.23870-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/4] avfilter/vf_zscale: properly check return value of slice threads 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: Marton Balint 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: Signed-off-by: Marton Balint --- libavfilter/vf_zscale.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c index bab87b0c94..ceefc95224 100644 --- a/libavfilter/vf_zscale.c +++ b/libavfilter/vf_zscale.c @@ -117,6 +117,7 @@ typedef struct ZScaleContext { void *tmp[MAX_THREADS]; //separate for each thread; int nb_threads; + int jobs_ret[MAX_THREADS]; zimg_image_format src_format, dst_format; zimg_image_format alpha_src_format, alpha_dst_format; @@ -858,12 +859,14 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) td.desc = desc; td.odesc = odesc; - ret = ff_filter_execute(ctx, filter_slice, &td, NULL, s->nb_threads); - if (ret < 0 || !s->graph[0]) { + memset(s->jobs_ret, 0, s->nb_threads * sizeof(*s->jobs_ret)); + ret = ff_filter_execute(ctx, filter_slice, &td, s->jobs_ret, s->nb_threads); + for (int i = 0; ret >= 0 && i < s->nb_threads; i++) + if (s->jobs_ret[i] < 0) + ret = s->jobs_ret[i]; + if (ret < 0) { av_frame_free(&in); av_frame_free(&out); - if (ret >= 0) - ret = AVERROR(EINVAL); return ret; } -- 2.31.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".