[FFmpeg-cvslog] lavf/srtdec: do not try to queue empty subtitle chunks.

Clément Bœsch git at videolan.org
Sun Jan 27 12:37:17 CET 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sun Jan 27 20:25:21 2013 +0900| [f2b6aabd3da7d0d15c7cea0a9fb649b530e2d3cb] | committer: Clément Bœsch

lavf/srtdec: do not try to queue empty subtitle chunks.

Regression since 3af3a30.
Fixes Ticket2167.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f2b6aabd3da7d0d15c7cea0a9fb649b530e2d3cb
---

 libavformat/srtdec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index 809d1d0..76e06e4 100644
--- a/libavformat/srtdec.c
+++ b/libavformat/srtdec.c
@@ -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);



More information about the ffmpeg-cvslog mailing list