PR #22603 opened by James Almer (jamrial)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22603
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22603.patch


>From 7f983dbc8472d227afa9cf28d16418097b2425a0 Mon Sep 17 00:00:00 2001
From: James Almer <[email protected]>
Date: Tue, 24 Mar 2026 13:25:26 -0300
Subject: [PATCH] avformat/mov: ignore duplicate streams referenced with an
 sbas tref entry

Signed-off-by: James Almer <[email protected]>
---
 libavformat/mov.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 2496b4fe5b..34a8ce3136 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -10787,7 +10787,8 @@ static AVStream 
*mov_find_reference_track(AVFormatContext *s, AVStream *st,
         return NULL;
 
     for (int i = first_index; i < s->nb_streams; i++)
-        if (s->streams[i]->id == sc->tref_id)
+        if (s->streams[i]->index != st->index &&
+            s->streams[i]->id == sc->tref_id)
             return s->streams[i];
 
     return NULL;
@@ -10829,8 +10830,12 @@ static int mov_parse_lcevc_streams(AVFormatContext *s)
             j = st_base->index + 1;
         }
         if (!j) {
-            av_log(s, AV_LOG_ERROR, "Failed to find base stream for 
enhancement stream\n");
-            return AVERROR_INVALIDDATA;
+            int loglevel = (s->error_recognition & AV_EF_EXPLODE) ? 
AV_LOG_ERROR : AV_LOG_WARNING;
+            av_log(s, loglevel, "Failed to find base stream for LCEVC 
stream\n");
+            ff_remove_stream_group(s, stg);
+            if (s->error_recognition & AV_EF_EXPLODE)
+                return AVERROR_INVALIDDATA;
+            continue;
         }
 
         err = avformat_stream_group_add_stream(stg, st);
-- 
2.52.0

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

Reply via email to