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 CE4894DA81 for ; Tue, 23 Dec 2025 03:18:54 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'He1YjEd7t6O5Yto0iEcovxceNV2MO3TTs9PmsI2qmtw=', expected b'RE6TNEH8rUuRndwTsl2MhlamEYauyIvNPytrt9xfhcM=')) 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=1766459928; h=mime-version : to : date : 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=He1YjEd7t6O5Yto0iEcovxceNV2MO3TTs9PmsI2qmtw=; b=tpbYIZLGs55jsPA5YvJebjvrHJMDwfyHvL6AC1QVzssANeQobayNKpp1ssg/Bc962WiD8 nif4BbeYqw48bmyXq9nZV9FXUi58VdVVmIP/CZLnV4YdbJSGtun3irUMgFV2qbXGZYW2wMv 7aWIGw01P8HMVyw8ln2LvzAnKF7w4wSDCKWpdXfvP+P9CGCdogemaZX20svAqWCOxnFGAfe GxYHoAtmwQcb0WP6Dpb+WL7qVNxs91erXgp3yanLvJw+b4j7GqnOUpThCKoveyuZtFLZWus h8Ln/GF0+/JJvN8G3+L2ZXZt48mcHdGvm8NR1KeHJSjseaV8luEhZ3xI2wRA== Received: from [172.20.0.2] (unknown [172.19.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 095C0690ABC; Tue, 23 Dec 2025 05:18:48 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1766459921; b=dkbWhTzfACDK17+7JA0tWcIIGeJBZV4ju0ENbZlng4mWOJy+6i/FYNto/1GndsqLwmf/D XgW+D11oJIl8LgG2Q3eSVOJL1w0jxaFx2pt0wGCDkXQqgSi9FBVaps1gWpw4yGA2UMTXogi J80H5vcwr413jZOnTZpLqweNT9DdTytMDXC4MP2qBf7UHNN0UBYW/WxU8DpKrryfoFOYMjO GX81PHaFSVeYGmi6OkzJmq5s2xSe86izFmc1uTe0OwcpykEr6XWI5bUA8YVd5sT/tTf/hY1 TdlqYknJy8HqB8LBUfa214ez/By+Dc0czpCWzsipuQ5vmzfh0oGmX9e9e8tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1766459921; 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=3eJ9FbY8mYjejn27l7FG/NVVY8DQnmR/csSzNtqpnS4=; b=QdydvV32KFWibbu+fF047/Rid38V5tYd8sLjKUAd8fW4tD0jlvnwZuQOCqQZB2WBnM9If wPjRap73zgtc5WnqovN2x6ikyr0BL+YYx2YEJJO/2kFgRJe04tVn3Grgm/XXskW3SHmrNOt 1A4kBpeC72hfztEIPt8E6IjAVdgaEH9kmUGsntpcUWkZCMMMGVuhSgWf+M547bFMI2O/Oan 58SoIYIpmb6t2m06ek0Dn7KG483EjOKHz+rgPFkvAkJEXy6Tr210JQpvJw9PMq8VWy2kpwp nK/SOkx2Oxpc4auF+2D8zcu2+c7BnLnOOQDW5uGe3UL4ng8MIZuDhntXm2QQ== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1766459914; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=RE6TNEH8rUuRndwTsl2MhlamEYauyIvNPytrt9xfhcM=; b=I4im4F7zI2NZZEf1HdajlMT63dB2xXyivyo8+6woSJLrigr9qcKzU9y+x2dL8AofJV+Xu TgXTTMFDgB0tSTOM2orwaAFbzwuCz1x1jzE3dIIS/5/8pkdF6EYWgDozaA/viQtT324NDoS ZdjxB6AnwvrhhXo9p4bPMpI67nBNinWBpwgXUoYVkvUNHLDl8aBfPyvj2B80KIE0QY6z+0r fW+8uxVkBc8CcwpfKsCYgbEq7iMvncyweuW9U6s7dNMYWrhmeaJ1/t9lq1kwT2oILjyhyLC xypZkebU1HlPUx7355ViknnClZBX7uTvi5Eirq1B5srHH/8q91/a2eM5RASA== Received: from 55ca25703178 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 7EA28690A8B for ; Tue, 23 Dec 2025 05:18:34 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Tue, 23 Dec 2025 03:18:34 -0000 Message-ID: <176645991467.60.10899247736433310855@2cb04c0e5124> Message-ID-Hash: JWLM7NCEBU4DPOTKXJHCSN7FH4PD56NR X-Message-ID-Hash: JWLM7NCEBU4DPOTKXJHCSN7FH4PD56NR X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation 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 X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] avcodec/libjxldec: goto SUCCESS when frame is completed (PR #21278) 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: Jack Lau via ffmpeg-devel Cc: Jack Lau Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21278 opened by Jack Lau (JackLau) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21278 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21278.patch Fix #21260 The early code didn't reset the JxlDecoder. If the caller re-send the same packet to JxlDecoder after avcodec_flush_buffers() (free ctx->frame). It will directly hit SUCCESS event (skip all EVENTs). In this case, the ctx->frame already flushed by avcodec_flush_buffers, so the received frame will be invalid (has no private_ref) that causes assertion in decode_receive_frame_internal(). MPV meet this issue because it seek the jxl image (second read the same pkt) when it does crop through config `C vf toggle crop=in_w:in_w/2.4`. This patch make sure hit the entire SUCCESS event (contains reset the JxlDecoder) when frame_complete is true. Signed-off-by: Jack Lau >>From fedb4b905d7adb495aa65bc37cf11aa6153464bf Mon Sep 17 00:00:00 2001 From: Jack Lau Date: Tue, 23 Dec 2025 10:53:23 +0800 Subject: [PATCH] avcodec/libjxldec: goto SUCCESS when frame is completed Fix #21260 The early code didn't reset the JxlDecoder. If the caller re-send the same packet to JxlDecoder after avcodec_flush_buffers() (free ctx->frame). It will directly hit SUCCESS event (skip all EVENTs). In this case, the ctx->frame already flushed by avcodec_flush_buffers, so the received frame will be invalid (has no private_ref) that causes assertion in decode_receive_frame_internal(). MPV meet this issue because it seek the jxl image (second read the same pkt) when it does crop through config `C vf toggle crop=in_w:in_w/2.4`. This patch make sure hit the entire SUCCESS event (contains reset the JxlDecoder) when frame_complete is true. Signed-off-by: Jack Lau --- libavcodec/libjxldec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/libjxldec.c b/libavcodec/libjxldec.c index a43437fb10..2aada927b4 100644 --- a/libavcodec/libjxldec.c +++ b/libavcodec/libjxldec.c @@ -450,9 +450,8 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) av_log(avctx, AV_LOG_ERROR, "Unexpected end of JXL codestream\n"); return AVERROR_INVALIDDATA; } else if (ctx->frame_complete) { - libjxl_finalize_frame(avctx, frame, ctx->frame); ctx->jret = JXL_DEC_SUCCESS; - return 0; + goto success; } return AVERROR_EOF; } @@ -584,6 +583,7 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) continue; } case JXL_DEC_SUCCESS: +success: av_log(avctx, AV_LOG_DEBUG, "SUCCESS event emitted\n"); /* * this event will be fired when the zero-length EOF -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org