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
1 changed files with 1 additions and 1 deletions

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