This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 303510f9d1 avcodec/cuviddec: drain queued output before parsing more
input
303510f9d1 is described below
commit 303510f9d1fe19bcae440df0d940f33616d93bf5
Author: hayateppp <>
AuthorDate: Thu Oct 22 09:17:32 2026 +0000
Commit: Timo Rothenpieler <[email protected]>
CommitDate: Thu Oct 22 12:17:34 2026 +0000
avcodec/cuviddec: drain queued output before parsing more input
A queued display entry holds a decode surface index, not a copy of its
pixels. Parsing another packet can reuse that surface before the entry
is mapped, associating a later image with the queued timestamp. The
queue occupancy check does not protect individual surface lifetimes.
Consume queued output before fetching another packet. In particular,
this drains both deinterlaced fields before submitting further input.
A generated 120-frame interlaced H.264 stream decoded with -deint bob
produces 157 incorrect images out of 240 on an RTX 5090. With this guard,
all 240 images match the software-decoded, spatially constant source
frames, and diagnostic logging no longer observes queued surface reuse.
Based on the candidate fix provided by hayateppp in issue #25210.
The original report's private inputs remain untested here.
Assisted-by: Fairy
---
libavcodec/cuviddec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
index 14744cf067..9bc174d2ee 100644
--- a/libavcodec/cuviddec.c
+++ b/libavcodec/cuviddec.c
@@ -913,7 +913,8 @@ static int cuvid_output_frame(AVCodecContext *avctx,
AVFrame *frame)
return ret;
}
- if (!cuvid_is_buffer_full(avctx)) {
+ // Consume queued output before parsing can reuse its decode surfaces.
+ if (!av_fifo_can_read(ctx->frame_queue) &&
!cuvid_is_buffer_full(avctx)) {
AVPacket *const pkt = ctx->pkt;
ret = ff_decode_get_packet(avctx, pkt);
if (ret < 0 && ret != AVERROR_EOF)
--
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]