summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2003-03-30 10:57:48 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2003-03-30 10:57:48 +0000
commit6218ab30a31e7d70ffe40b282bfc5ebeb5c3d13c (patch)
treee053cec9682e7ff6fc2328dcaaf334af5dc392c2
parentc95265e925484c7fb0fedbfedac3b007bde99f33 (diff)
downloadxine-lib-6218ab30a31e7d70ffe40b282bfc5ebeb5c3d13c.tar.gz
xine-lib-6218ab30a31e7d70ffe40b282bfc5ebeb5c3d13c.tar.bz2
additional sanity check on the part number
CVS patchset: 4511 CVS date: 2003/03/30 10:57:48
-rw-r--r--src/input/input_dvd.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index f5b003cad..f38dcbe04 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_dvd.c,v 1.137 2003/03/29 13:19:08 mroi Exp $
+ * $Id: input_dvd.c,v 1.138 2003/03/30 10:57:48 mroi Exp $
*
*/
@@ -1334,7 +1334,7 @@ static input_plugin_t *open_plugin (input_class_t *class_gen, xine_stream_t *str
if(this->mode == MODE_TITLE) {
int tt, i, pr, found;
- int titles;
+ int titles, parts;
/* A program and/or VTS was specified */
@@ -1362,6 +1362,14 @@ static input_plugin_t *open_plugin (input_class_t *class_gen, xine_stream_t *str
if(found != -1) {
pr = strtol(locator+found+1, NULL,10);
}
+ dvdnav_get_number_of_parts(this->dvdnav, tt, &parts);
+ if ((pr == 0) || (pr > parts)) {
+ printf("input_dvd: Part %i is out of range (1 to %i).\n", pr,
+ parts);
+ dvdnav_close(this->dvdnav);
+ this->dvdnav = NULL;
+ return 0;
+ }
#ifdef INPUT_DEBUG
printf("input_dvd: Jumping to TT >%i<, PTT >%i<\n", tt, pr);
#endif
@@ -1617,6 +1625,9 @@ static void *init_class (xine_t *xine, void *data) {
/*
* $Log: input_dvd.c,v $
+ * Revision 1.138 2003/03/30 10:57:48 mroi
+ * additional sanity check on the part number
+ *
* Revision 1.137 2003/03/29 13:19:08 mroi
* sync to libdvdnav cvs once again
* * some changes to mutual header inclusion to make it compile warning-less