summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-13 21:32:28 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-13 21:32:28 +0000
commite817ade915c8fdd97c3ea8e7cf00216bd8f7fce7 (patch)
tree3539c84e76de0bb7bc5eeae87e039421c4511035 /libmpdemux
parentc0298b66cd5ac06f7036aae6b2ad4972dfaed5c8 (diff)
downloadmpv-e817ade915c8fdd97c3ea8e7cf00216bd8f7fce7.tar.bz2
mpv-e817ade915c8fdd97c3ea8e7cf00216bd8f7fce7.tar.xz
Fixed segfault with (dvd://1 -chapter). Bug reported by Gabucino, initial fix by Pierre.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10602 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/open.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libmpdemux/open.c b/libmpdemux/open.c
index 84a9f0d9aa..8dca73ad24 100644
--- a/libmpdemux/open.c
+++ b/libmpdemux/open.c
@@ -535,7 +535,8 @@ if(strncmp("dvd://",filename,6) == 0){
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 @@ int dvd_parse_chapter_range(m_option_t *conf, const char *range){
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;
}