diff mbox series

[FFmpeg-devel,2/3] avformat/mxfdec: support Avid files with an extra index entry

Message ID 20221228031958.26570-2-cus@passwd.hu
State Accepted
Commit 41dfa629d752145d73e56023a361ce487a3d4e8f
Headers show
Series [FFmpeg-devel,1/3] avformat/mxfdec: check index entry array size | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Marton Balint Dec. 28, 2022, 3:19 a.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/mxfdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index ad4ee15570..2e61e77d67 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1991,11 +1991,11 @@  static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta
         int index_delta = 1;
         int n = s->nb_index_entries;
 
-        if (s->nb_index_entries == 2 * s->index_duration + 1) {
+        if (s->nb_index_entries == 2 * s->index_duration + 1)
             index_delta = 2;    /* Avid index */
-            /* ignore the last entry - it's the size of the essence container */
+        if (s->nb_index_entries == index_delta * s->index_duration + 1)
+            /* ignore the last entry - it's the size of the essence container in Avid */
             n--;
-        }
 
         for (j = 0; j < n; j += index_delta, x++) {
             int offset = s->temporal_offset_entries[j] / index_delta;