]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/srtdec.c
Merge commit '48a4ffa722c0874b251de9d201babed52cef0bcb'
[ffmpeg] / libavformat / srtdec.c
index 809d1d064acf4b48d38abb840cd8b1ae83b7b458..76e06e416546b256138d28209dd51c0c4e71af37 100644 (file)
@@ -100,6 +100,8 @@ static int srt_read_header(AVFormatContext *s)
             pts = get_pts(&ptr, &duration, &x1, &y1, &x2, &y2);
             if (pts != AV_NOPTS_VALUE) {
                 int len = buf.len - (ptr - buf.str);
+                if (len <= 0)
+                    continue;
                 sub = ff_subtitles_queue_insert(&srt->q, ptr, len, 0);
                 if (!sub) {
                     res = AVERROR(ENOMEM);