mirror of https://github.com/mpv-player/mpv
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:
parent
86a5b7a4cc
commit
6c141b60b5
|
@ -1106,9 +1106,11 @@ static subtitle *sub_read_line_jacosub(stream_t* st, subtitle * current,
|
|||
} //-- switch
|
||||
} //-- for
|
||||
*q = '\0';
|
||||
current->text[current->lines] = strdup(line1);
|
||||
if (current->lines < SUB_MAX_TEXT)
|
||||
current->text[current->lines] = strdup(line1);
|
||||
} //-- while
|
||||
current->lines++;
|
||||
if (current->lines < SUB_MAX_TEXT)
|
||||
current->lines++;
|
||||
return current;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue