From e8235b8140cf6bd16c22b60c4c703c25b931088c Mon Sep 17 00:00:00 2001 From: arpi Date: Fri, 31 May 2002 21:48:36 +0000 Subject: sub_read_line_ssa sig11 fix by Jindrich Makovicka when this function encounters a multiline subtitle with more lines than SUB_MAX_TEXT, this stupid bug manifests. The function actually reads one line less than the returned count. Subsequently, either during iconv or during playing a null pointer gets referenced, with obvious result. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6248 b3059339-0415-0410-9bf9-f77b7e298cf2 --- subreader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'subreader.c') diff --git a/subreader.c b/subreader.c index df5d00bcc0..003303d63e 100644 --- a/subreader.c +++ b/subreader.c @@ -396,7 +396,7 @@ subtitle *sub_read_line_ssa(FILE *fd,subtitle *current) { line2 ++; line2 ++; - current->lines=1;num=0; + current->lines=0;num=0; current->start = 360000*hour1 + 6000*min1 + 100*sec1 + hunsec1; current->end = 360000*hour2 + 6000*min2 + 100*sec2 + hunsec2; @@ -410,8 +410,8 @@ subtitle *sub_read_line_ssa(FILE *fd,subtitle *current) { if (current->lines >= SUB_MAX_TEXT) return current; } - current->text[num]=strdup(line2); + current->lines++; return current; } -- cgit v1.2.3