This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/9.1
in repository ffmpeg.

commit bc43de69f33b287ef9128b76dee5f0e2dd88b623
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Tue Nov 3 04:46:19 2026 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Sun Nov 15 05:26:09 2026 +0100

    avcodec/mimic: set up the bit reader before publishing the frame
    
    Fixes: ZiiTReozL7KE
    Fixes: AISLE-2026-0150-00435
    Fixes: deadlock
    Deadlock Replicated through UnModified FFmpeg with timeout (AVI with a
    268435476 byte Mimic intra frame followed by inter frames; ffmpeg with
    frame threading never exits)
    
    Found-by: Joshua Rogers (AISLE)
    (cherry picked from commit db77b0b8318ddb38b5a3227724da088a325a4308)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/mimic.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c
index e9ed1a9b7c..e9f77d90d9 100644
--- a/libavcodec/mimic.c
+++ b/libavcodec/mimic.c
@@ -385,6 +385,17 @@ static int mimic_decode_frame(AVCodecContext *avctx, 
AVFrame *rframe,
         return AVERROR_INVALIDDATA;
     }
 
+    av_fast_padded_malloc(&ctx->swap_buf, &ctx->swap_buf_size, swap_buf_size);
+    if (!ctx->swap_buf)
+        return AVERROR(ENOMEM);
+
+    ctx->bbdsp.bswap_buf(ctx->swap_buf,
+                         (const uint32_t *) (buf + MIMIC_HEADER_SIZE),
+                         swap_buf_size >> 2);
+    res = init_get_bits8(&ctx->gb, ctx->swap_buf, swap_buf_size);
+    if (res < 0)
+        return res;
+
     ff_progress_frame_unref(&ctx->frames[ctx->cur_index]);
     res = ff_progress_frame_get_buffer(avctx, &ctx->frames[ctx->cur_index],
                                        AV_GET_BUFFER_FLAG_REF);
@@ -398,17 +409,6 @@ static int mimic_decode_frame(AVCodecContext *avctx, 
AVFrame *rframe,
 
     ff_thread_finish_setup(avctx);
 
-    av_fast_padded_malloc(&ctx->swap_buf, &ctx->swap_buf_size, swap_buf_size);
-    if (!ctx->swap_buf)
-        return AVERROR(ENOMEM);
-
-    ctx->bbdsp.bswap_buf(ctx->swap_buf,
-                         (const uint32_t *) (buf + MIMIC_HEADER_SIZE),
-                         swap_buf_size >> 2);
-    res = init_get_bits8(&ctx->gb, ctx->swap_buf, swap_buf_size);
-    if (res < 0)
-        return res;
-
     res = decode(ctx, quality, num_coeffs, !is_pframe);
     ff_progress_frame_report(&ctx->frames[ctx->cur_index], INT_MAX);
     if (res < 0) {

-- 
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]

Reply via email to