From 07be95eb3dc9d3a504df8d78a80c9136fbe2e866 Mon Sep 17 00:00:00 2001 From: James Courtier-Dutton Date: Sat, 28 Aug 2004 22:51:50 +0000 Subject: Fix a crash when dispose it called before the DVD starts playing. This needs to be fixed in libdvdnav as well. CVS patchset: 6916 CVS date: 2004/08/28 22:51:50 --- src/input/input_dvd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 076ba20f0..4ce0d4fcc 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.188 2004/08/28 15:06:26 jcdutton Exp $ + * $Id: input_dvd.c,v 1.189 2004/08/28 22:51:50 jcdutton Exp $ * */ @@ -409,7 +409,8 @@ static void dvd_plugin_dispose (input_plugin_t *this_gen) { xine_event_dispose_queue (this->event_queue); ((dvd_input_class_t *)this_gen->input_class)->ip = NULL; - dvdnav_close(this->dvdnav); + if (this->dvdnav) + dvdnav_close(this->dvdnav); pthread_mutex_lock(&this->buf_mutex); if (this->mem_stack) { @@ -420,7 +421,8 @@ static void dvd_plugin_dispose (input_plugin_t *this_gen) { } else { pthread_mutex_unlock(&this->buf_mutex); pthread_mutex_destroy(&this->buf_mutex); - free(this->mem); + if (this->mem) + free(this->mem); free(this); } } -- cgit v1.2.3