]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/matroskadec.c
Merge commit '9df889a5f116c1ee78c2f239e0ba599c492431aa'
[ffmpeg] / libavformat / matroskadec.c
index f3d701fe4d0b590cbe7f60c88d92f8ada2ab3148..60b1b345d266f52ff5b6213b64e7ddbd887954ec 100644 (file)
@@ -3150,7 +3150,10 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
 
     if (matroska->skip_to_keyframe &&
         track->type != MATROSKA_TRACK_TYPE_SUBTITLE) {
-        if (timecode < matroska->skip_to_timecode)
+        // Compare signed timecodes. Timecode may be negative due to codec delay
+        // offset. We don't support timestamps greater than int64_t anyway - see
+        // AVPacket's pts.
+        if ((int64_t)timecode < (int64_t)(matroska->skip_to_timecode))
             return res;
         if (is_keyframe)
             matroska->skip_to_keyframe = 0;