From 6dccfe832a22aea7eb2448234e6844969036f02d Mon Sep 17 00:00:00 2001 From: atmos4 Date: Mon, 10 Dec 2001 14:48:02 +0000 Subject: 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 --- subreader.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'subreader.c') 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!='|') { -- cgit v1.2.3