PR #23131 opened by llyyr
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23131
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23131.patch

This can only happen when events are malformed, with a Start timestamp
later than the End timestamp. We shouldn't mark such events as invalid
and ignore them.

Fixes: https://github.com/mpv-player/mpv/issues/17935


>From 82ad9ab565fd375678cb78b5bb74460accb72749 Mon Sep 17 00:00:00 2001
From: llyyr <[email protected]>
Date: Sun, 17 May 2026 21:48:00 +0530
Subject: [PATCH] avforamt/assdec: reject events with duration <= 0

This can only happen when events are malformed, with a Start timestamp
later than the End timestamp. We shouldn't mark such events as invalid
and ignore them.

Fixes: https://github.com/mpv-player/mpv/issues/17935
---
 libavformat/assdec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index 3a8353f4d3..7808d55fd3 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -138,6 +138,10 @@ static int ass_read_header(AVFormatContext *s)
             av_bprintf(&header, "%s", line.str);
             continue;
         }
+
+        if (duration <= 0)
+            continue;
+
         sub = ff_subtitles_queue_insert_bprint(&ass->q, &rline, 0);
         if (!sub) {
             res = AVERROR(ENOMEM);
-- 
2.52.0

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

Reply via email to