diff options
author | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-10 14:48:02 +0000 |
---|---|---|
committer | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-10 14:48:02 +0000 |
commit | 6dccfe832a22aea7eb2448234e6844969036f02d (patch) | |
tree | d50efcf950e8f764264678287e73e1066b6ed940 /subreader.c | |
parent | 35e0c399d1c6fce3138892e888deccf0ba56aab1 (diff) | |
download | mpv-6dccfe832a22aea7eb2448234e6844969036f02d.tar.bz2 mpv-6dccfe832a22aea7eb2448234e6844969036f02d.tar.xz |
Patch by artur Zaprzala:
This patch adds test for NULL return value of strchr().
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3434 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'subreader.c')
-rw-r--r-- | subreader.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/subreader.c b/subreader.c index d9e31c247d..05512a5397 100644 --- a/subreader.c +++ b/subreader.c @@ -273,8 +273,14 @@ subtitle *sub_read_line_vplayer(FILE *fd,subtitle *current) { p=line; // finds the body of the subtitle for (i=0; i<3; i++){ - p=strchr(p,':')+1; - } + p=strchr(p,':'); + if (p==NULL) break; + ++p; + } + if (p==NULL) { + printf("SUB: Skipping incorrect subtitle line!\n"); + continue; + } i=0; if (*p!='|') { |