diff mbox series

[FFmpeg-devel,12/15] GOL-1361: Remove invalid CTTS sample_offset check

Message ID b50adce0881fdc74ccc618d5dcf936c0b6e52917.camel@haerdin.se
State New
Headers show
Series Spotify patchset | expand

Commit Message

Tomas Härdin Oct. 29, 2024, 2:50 p.m. UTC
Needs a sample

Spotify comments
----------------
mp4 file fails to demux due to CTTS sample offset check that seems to
contradict specification

https://github.com/FFmpeg/FFmpeg/commit/4093220029a4d77f272c491e9299680480a08c00
the trac ticket for that change: https://trac.ffmpeg.org/ticket/385

a new ticket that i created that highlights that that change is a
problem: https://trac.ffmpeg.org/ticket/10326

/Tomas
diff mbox series

Patch

From 2ff08af29b921fba3dfa2d084739e91e2d6364eb Mon Sep 17 00:00:00 2001
From: ekir <ekir@spotify.com>
Date: Tue, 18 Apr 2023 17:31:43 +0200
Subject: [PATCH 12/15] GOL-1361: Remove invalid CTTS sample_offset check

We checked in this places:
* In 8.6.1.3 of ISO/IEC 14496-12 about the CTTS box
* In Apples MOV spec: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-SW19
---
 libavformat/mov.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 73d337c882..89e6633bfa 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3871,13 +3871,6 @@  static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         av_log(c->fc, AV_LOG_TRACE, "count=%d, duration=%d\n",
                 count, duration);
 
-        if (FFNABS(duration) < -(1<<28) && i+2<entries) {
-            av_log(c->fc, AV_LOG_WARNING, "CTTS invalid\n");
-            av_freep(&sc->ctts_data);
-            sc->ctts_count = 0;
-            return 0;
-        }
-
         if (i+2<entries)
             mov_update_dts_shift(sc, duration, c->fc);
     }
-- 
2.39.2