Commit ae4bf0e32d for ffmpeg
commit ae4bf0e32d2a0d326e93271d462e18ae74c3cd5a
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Tue Nov 3 20:41:10 2026 +0100
avcodec/libjxldec: return EOF after reporting a truncated codestream
Regression since 2c8835dd72.
Fixes: infinite loop
Fixes: k8CycfOvfx1i
Found during triage of the security report OBQVvFEd6jIZ
Infinite loop Replicated through UnModified FFmpeg with a timeout
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
diff --git a/libavcodec/libjxldec.c b/libavcodec/libjxldec.c
index 6eb134416d..693c2b48e1 100644
--- a/libavcodec/libjxldec.c
+++ b/libavcodec/libjxldec.c
@@ -450,6 +450,7 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame)
/* jret set by the last iteration of the loop */
if (ctx->jret == JXL_DEC_NEED_MORE_INPUT && !ctx->frame_complete) {
av_log(avctx, AV_LOG_ERROR, "Unexpected end of JXL codestream\n");
+ ctx->jret = JXL_DEC_ERROR;
return AVERROR_INVALIDDATA;
} else if (ctx->frame_complete) {
ctx->jret = JXL_DEC_SUCCESS;