[Mplayer-cvslog] CVS: main/libmpdemux open.c,1.86,1.87
Alex Beregszaszi
alex at mplayerhq.hu
Wed Aug 13 23:33:00 CEST 2003
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv16465
Modified Files:
open.c
Log Message:
Fixed segfault with (dvd://1 -chapter). Bug reported by Gabucino, initial fix by Pierre.
Index: open.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/open.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- open.c 13 Aug 2003 16:29:31 -0000 1.86
+++ open.c 13 Aug 2003 21:32:28 -0000 1.87
@@ -535,7 +535,8 @@
int dvd_parse_chapter_range(m_option_t *conf, const char *range){
const char *s;
char *t;
-/* conf; prevent warning from GCC */
+ if (!range)
+ return M_OPT_MISSING_PARAM;
s = range;
dvd_chapter = 1;
dvd_last_chapter = 0;
@@ -543,26 +544,26 @@
dvd_chapter = strtol(range, &s, 10);
if (range == s) {
mp_msg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
- return -1;
+ return M_OPT_INVALID;
}
}
if (*s == 0)
return 0;
else if (*s != '-') {
mp_msg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
- return -1;
+ return M_OPT_INVALID;
}
++s;
if (*s == 0)
return 0;
if (! isdigit(*s)) {
mp_msg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
- return -1;
+ return M_OPT_INVALID;
}
dvd_last_chapter = strtol(s, &t, 10);
if (s == t || *t) {
mp_msg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
- return -1;
+ return M_OPT_INVALID;
}
return 0;
}
More information about the MPlayer-cvslog
mailing list