Commit ab7d76a30a for ffmpeg
commit ab7d76a30aa732c049461b2fc356a9a43378c264
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Thu Nov 12 02:15:27 2026 +0100
avcodec/cfhd: do not allocate buffers in the next thread when the previous one has none
Fixes: PsK6Vw5ds9CE
Found during the triage of a finding from the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25015
Loss of all following frames Replicated through UnModified FFmpeg
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index e4f54ba196..8033fac69d 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -1443,6 +1443,9 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
pdst->progressive = psrc->progressive;
pdst->planes = psrc->planes;
+ if (!psrc->plane[0].idwt_buf)
+ return 0;
+
if (!pdst->plane[0].idwt_buf) {
pdst->coded_width = pdst->a_width;
pdst->coded_height = pdst->a_height;