diff --git a/lib/_cdio_osx.c b/lib/_cdio_osx.c index ea342121..636787d3 100644 --- a/lib/_cdio_osx.c +++ b/lib/_cdio_osx.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_osx.c,v 1.64 2004/08/29 03:45:34 rocky Exp $ + $Id: _cdio_osx.c,v 1.65 2004/08/30 01:14:14 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein from vcdimager code: @@ -34,7 +34,7 @@ #include "config.h" #endif -static const char _rcsid[] = "$Id: _cdio_osx.c,v 1.64 2004/08/29 03:45:34 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_osx.c,v 1.65 2004/08/30 01:14:14 rocky Exp $"; #include #include @@ -1097,6 +1097,7 @@ _get_first_track_num_osx(void *user_data) _img_private_t *p_env = user_data; if (!p_env->gen.toc_init) read_toc_osx (p_env) ; + if (!p_env->gen.toc_init) return CDIO_INVALID_TRACK; return p_env->i_first_track; } @@ -1131,6 +1132,7 @@ _get_num_tracks_osx(void *user_data) _img_private_t *p_env = user_data; if (!p_env->gen.toc_init) read_toc_osx (p_env) ; + if (!p_env->gen.toc_init) return CDIO_INVALID_TRACK; return( TOTAL_TRACKS ); } diff --git a/src/cd-info.c b/src/cd-info.c index 32e52fb2..8243ac12 100644 --- a/src/cd-info.c +++ b/src/cd-info.c @@ -1,5 +1,5 @@ /* - $Id: cd-info.c,v 1.86 2004/08/30 01:01:14 rocky Exp $ + $Id: cd-info.c,v 1.87 2004/08/30 01:14:14 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein Copyright (C) 1996, 1997, 1998 Gerd Knorr @@ -1040,7 +1040,12 @@ main(int argc, const char *argv[]) } i_first_track = cdio_get_first_track_num(p_cdio); - i_tracks = cdio_get_num_tracks(p_cdio); + + if (CDIO_INVALID_TRACK == i_first_track) { + err_exit("Can't number of tracks, I give up.\n"); + } + + i_tracks = cdio_get_num_tracks(p_cdio); if (!opts.no_tracks) { printf("CD-ROM Track List (%i - %i)\n" NORMAL,