Commit 98540b5efa for ffmpeg
commit 98540b5efa2b8a6f0f0d4036a827df1f254e2ac0
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Sun Nov 8 02:05:58 2026 +0100
avcodec/cuviddec: clear the callback error once it has been reported
Fixes: infinite loop
Fixes: h7TSdP1ov8N5
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25231
Infinite loop Replicated through UnModified FFmpeg with gdb
diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
index c47240d6e1..bc0731652b 100644
--- a/libavcodec/cuviddec.c
+++ b/libavcodec/cuviddec.c
@@ -889,6 +889,7 @@ static int cuvid_decode_packet(AVCodecContext *avctx, const AVPacket *avpkt)
if (ctx->internal_error) {
av_log(avctx, AV_LOG_ERROR, "cuvid decode callback error\n");
ret = ctx->internal_error;
+ ctx->internal_error = 0;
goto error;
}