# HG changeset patch # User atmos4 # Date 1007995682 0 # Node ID 8519aba2644d15d21425f6cb560863cca1c384b1 # Parent 5cb7caab5536117aeb5edca0f6a9689b36adb3ff Patch by artur Zaprzala: This patch adds test for NULL return value of strchr(). diff -r 5cb7caab5536 -r 8519aba2644d subreader.c --- a/subreader.c Mon Dec 10 14:41:44 2001 +0000 +++ b/subreader.c Mon Dec 10 14:48:02 2001 +0000 @@ -273,8 +273,14 @@ 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!='|') {