1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

100l in play_tree_parser_get_line, check that there actually is

a previous character before comparing it against '\r'.
Fixes a possible crash on playlist file that is empty or starts with an empty line.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25169 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2007-11-26 20:35:27 +00:00
parent b32b64d559
commit 2e369b6908

View File

@ -93,7 +93,7 @@ play_tree_parser_get_line(play_tree_parser_t* p) {
break;
}
line_end = ((*(end-1)) == '\r') ? end-1 : end;
line_end = (end > p->iter && *(end-1) == '\r') ? end-1 : end;
if(line_end - p->iter >= 0)
p->line = (char*)realloc(p->line,line_end - p->iter+1);
else