PR #25763 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25763
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25763.patch

render_slice() and await_reference_row() count rows in coding order for
both image orientations, but vp3_draw_horiz_band() reported height - y
for old Theora bitstreams with a flipped image. The progress was highest
after the first slice and never reached INT_MAX, so with frame threading
the next frame read reference rows before they were decoded or waited
for them forever.

Fixes: Timeout
Fixes: clusterfuzz-testcase-minimized-fuzzer_loadfile_mkv-5633304502796288
Found-by: https://github.com/google/oss-fuzz/tree/master/projects/mpv


From f10eb4bdff790a342c6a8db0843c3d5e0235b3a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 4 Nov 2026 19:54:18 +0100
Subject: [PATCH] avcodec/vp3: report progress in coding order for flipped
 images
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

render_slice() and await_reference_row() count rows in coding order for
both image orientations, but vp3_draw_horiz_band() reported height - y
for old Theora bitstreams with a flipped image. The progress was highest
after the first slice and never reached INT_MAX, so with frame threading
the next frame read reference rows before they were decoded or waited
for them forever.

Fixes: Timeout
Fixes: clusterfuzz-testcase-minimized-fuzzer_loadfile_mkv-5633304502796288
Found-by: https://github.com/google/oss-fuzz/tree/master/projects/mpv
Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavcodec/vp3.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 9b6b9901d89..0bf14d155e8 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1896,14 +1896,11 @@ static void vp3_draw_horiz_band(Vp3DecodeContext *s, 
int y)
     int offset[AV_NUM_DATA_POINTERS];
 
     if (HAVE_THREADS && s->avctx->active_thread_type & FF_THREAD_FRAME) {
-        int y_flipped = s->flipped_image ? s->height - y : y;
-
         /* At the end of the frame, report INT_MAX instead of the height of
          * the frame. This makes the other threads' ff_thread_await_progress()
          * calls cheaper, because they don't have to clip their values. */
         ff_progress_frame_report(&s->current_frame,
-                                 y_flipped == s->height ? INT_MAX
-                                                        : y_flipped - 1);
+                                 y == s->height ? INT_MAX : y - 1);
     }
 
     if (!s->avctx->draw_horiz_band)
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to