subreader: do not write outside array bounds

Extra checks to ensure we really do not write outside
array bounds.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35313 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2012-10-31 20:05:31 +00:00 committed by wm4
parent 86a5b7a4cc
commit 6c141b60b5
1 changed files with 4 additions and 2 deletions

View File

@ -1106,9 +1106,11 @@ static subtitle *sub_read_line_jacosub(stream_t* st, subtitle * current,
} //-- switch } //-- switch
} //-- for } //-- for
*q = '\0'; *q = '\0';
current->text[current->lines] = strdup(line1); if (current->lines < SUB_MAX_TEXT)
current->text[current->lines] = strdup(line1);
} //-- while } //-- while
current->lines++; if (current->lines < SUB_MAX_TEXT)
current->lines++;
return current; return current;
} }