summaryrefslogtreecommitdiff
path: root/libavformat/srtdec.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-01-27 20:25:21 +0900
committerClément Bœsch <ubitux@gmail.com>2013-01-27 20:26:35 +0900
commitf2b6aabd3da7d0d15c7cea0a9fb649b530e2d3cb (patch)
tree3e09be8d0953e4648efe9c1281cbd048f5564e48 /libavformat/srtdec.c
parent07a7145d89fb2dcf7c85b36f10306cea5f2027d4 (diff)
downloadffmpeg-f2b6aabd3da7d0d15c7cea0a9fb649b530e2d3cb.tar.gz
lavf/srtdec: do not try to queue empty subtitle chunks.
Regression since 3af3a30. Fixes Ticket2167.
Diffstat (limited to 'libavformat/srtdec.c')
-rw-r--r--libavformat/srtdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index 809d1d064a..76e06e4165 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);