From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id C7B454BD8B for ; Wed, 27 Aug 2025 15:55:05 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'rWgJ1OouwmYMaCsbJWY6Kbx4gxzCVxbk0VSyIVMPL28=', expected b'dZt4Ot7eljfjFikFILObBSWicD9jXPHwZeFZD3snAhU=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1756310100; h=mime-version : to : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=rWgJ1OouwmYMaCsbJWY6Kbx4gxzCVxbk0VSyIVMPL28=; b=sqKl3DCruAVOutpGPZetfur4foTklJSrOcq+4F2BiuXVqe8s+yShg4OZP+PtuZ69uMv61 QI3W21SodSxfDwkffX//haUNM0DFDQWS7+Tq0n0aiS7ktlC6sw3Z+ENY2UY1gMYCIOdtfGG 6ce9eX+687EJ40AmXVqhGBWj83MTYyanEdnsiszGYlu7mSCEhOJfSeccFgJKPxR5BA2TWdT O+ntvsD2+N/RUopvocMAu6ex87T8l3E315k7IZVaef0IgN4jN754jYgwPZkfQs/FvK8Emdc txkj1/fNcaaD8vZAKp6iOJcudD4D40rc+bzItjSFe1YwLLUNpSdFvU0ElQQA== Received: from [172.18.0.4] (unknown [172.19.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 189FB68E7B9; Wed, 27 Aug 2025 18:55:00 +0300 (EEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1756310090; b=pbGXkxlrl+A1hlMH5QEsfDWPXvXep9X0LsBsdMyKN/LqUWfwPOU3NtSgULWwtDMcb65qB lOlgcVDoKaHGEpGEIpHboRVP64hr0i9qGaRjkoT0GQipLnHhaGEH5JDG/Moaj8T2H4jI4wv zjoAy+cRHfnmle0MlO+PM805ttxnLfe3qL+Ed77aS1ihgF6SSKpVswALpdX5bIQKfNlROes 0LkSkeiKNvi/PdHahzjG3D58lGLJ4dmFIRxcO5iwfZWRxz4N5U30wxFDGl2U/gfeHq1bgx1 E+RKAyy/ojEF/1Nl+8MVc8U3huSa93gmox+DyWppbY96FX2u0X1BeBXRpn0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1756310090; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=W9Bowyir6dx8wtG5e8XC/1vObsi+ie98RXj8+8XVI10=; b=ml0hf5A157i20ExgpI445wNRnnP8WFl0nOwx+5pr+4RiIM0Z8FB+VwLn6rKIq/4S/Un4B SE2HGma8uFLegw3ieKimEgWD4MzCTRo5+WBaG11GMt9VfLqoscLbpcpIv6LuHRDKzuGqz7e V8P1+tzzucIl+TSb+rzdz6ppeqo62w5Gdb7o0Uue9ft0//u2cFjf9c3M0KjNmWAQgSGt8Tg SI4L2d69PmkA5LDc6AMGKX6MuZmWjQgeMAXc3h0ELMBz1/Hehq5iGSzhjPb5lKKzNyAdwRL BInoIkm7x5XP4V9HE7djtlZ+zXJTocBrmX0IZGZ8e6IYoX8TV51Qmf5SFl+A== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=none Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1756310082; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : from; bh=dZt4Ot7eljfjFikFILObBSWicD9jXPHwZeFZD3snAhU=; b=LAfQAwXZWYDMyA8K0XWwOtLo35gct6MElCdr+o+cMlXuMSOPTXmGVO6tsnkEoV10WQ7m1 5PDctP6d2CycSzlmTuOp5Sm1Y0D0fMf/1kWGvGPrau7khsAgNPtDkE9OKljViu9YXDcXjgh NuM6+EWnvstNsweqe+4Ayy1eWgj8A2l3F8dITLwSYQiHcLzbpL7/fVzQPBYU7IfC88WgtGZ C+HtEWex1P0Js1scoCDNbLa+Zq5Q62+gZG+BzqMnpXT0YQP08QNqRH0Vwoztu63GqSZx/8q zeNIbHfvnr0dTVRcUCbHcZOS/V5wSdV2DnuXQDfD102ezSt87jbIMwjOhK9Q== Received: from 5d8f51c41678 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 202C768E6E7 for ; Wed, 27 Aug 2025 18:54:42 +0300 (EEST) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Message-ID: <175631008228.34.5310534105008804685@5a0384606a8e> Message-ID-Hash: LGYVQNGQZ3JF6MPP57W7Z3DNOFIOWXZ5 X-Message-ID-Hash: LGYVQNGQZ3JF6MPP57W7Z3DNOFIOWXZ5 X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] avcodec/libjxldec: consume input on error (PR #20355) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Leo Izen via ffmpeg-devel Cc: Leo Izen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20355 opened by Leo Izen (Traneptora) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20355 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20355.patch libjxl consumes no input if it returns an error, so this loops over and over while it spits out the same error many times. If we got an error from libjxl and consumed no input, then we instead consume the whole packet. Signed-off-by: Leo Izen >>From d808b0fc63506f224182872a78e6d2646e4e177d Mon Sep 17 00:00:00 2001 From: Leo Izen Date: Wed, 27 Aug 2025 11:53:23 -0400 Subject: [PATCH] avcodec/libjxldec: consume input on error libjxl consumes no input if it returns an error, so this loops over and over while it spits out the same error many times. If we got an error from libjxl and consumed no input, then we instead consume the whole packet. Signed-off-by: Leo Izen --- libavcodec/libjxldec.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavcodec/libjxldec.c b/libavcodec/libjxldec.c index 8ce69015bf..6e42b3bb2c 100644 --- a/libavcodec/libjxldec.c +++ b/libavcodec/libjxldec.c @@ -414,12 +414,22 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) * the number of bytes that it did read */ remaining = JxlDecoderReleaseInput(ctx->decoder); - pkt->data += pkt->size - remaining; + size_t consumed = pkt->size - remaining; + pkt->data += consumed; pkt->size = remaining; switch(jret) { case JXL_DEC_ERROR: av_log(avctx, AV_LOG_ERROR, "Unknown libjxl decode error\n"); + if (!consumed) { + /* + * we consume all remaining input on error, if nothing was consumed + * this prevents libjxl from consuming nothing forever + * and just dumping the last error over and over + */ + pkt->data += pkt->size; + pkt->size = 0; + } return AVERROR_INVALIDDATA; case JXL_DEC_NEED_MORE_INPUT: av_log(avctx, AV_LOG_DEBUG, "NEED_MORE_INPUT event emitted\n"); -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org