Commit e11ab82858 for ffmpeg

commit e11ab8285859ef067fbb3339f64eefabad10e367
Author: Michael Niedermayer <michael@niedermayer.cc>
Date:   Sat Oct 10 06:48:07 2026 +0200

    avformat/mov: skip empty edits in the middle of an edit list

    Only empty edits at the start of the list were skipped; an empty edit
    after a non-empty one was replayed as media starting at time -1, so the
    first frames of the track were emitted again where the presentation has
    a gap (ISO/IEC 14496-12 8.6.6.3). Skip every empty edit; its duration
    still advances the timeline so the following edit starts after the gap,
    while only the leading ones keep counting towards the start time.

    Found during triage/review of OSS-Fuzz issue 476170159

    Fixes: qqcLfY5ZRyHL
    Regression since: 97f47fd601d0e380109f501e4aabff71ffbad052

    Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

diff --git a/libavformat/mov.c b/libavformat/mov.c
index c710e21bdd..90decf17f5 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4594,8 +4594,9 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
             break;
         }
         num_discarded_begin = 0;
-        if (!found_non_empty_edit && edit_list_media_time == -1) {
-            empty_edits_sum_duration += edit_list_duration;
+        if (edit_list_media_time == -1) {
+            if (!found_non_empty_edit)
+                empty_edits_sum_duration += edit_list_duration;
             continue;
         }
         found_non_empty_edit = 1;