[DVDnav-discuss] r1206 - trunk/libdvdnav/src/dvdnav.c

erik subversion at mplayerhq.hu
Sat Jul 31 01:34:11 CEST 2010


Author: erik
Date: Sat Jul 31 01:34:11 2010
New Revision: 1206

Log:
Prevent deadlock in dvdnav_reset

dvdnav_reset takes a lock and then calls dvdnav_clear (which
also takes the same lock). This causes a deadlock. If the lock
is released before dvdnav_clear is called, all is well.

Derived from a patch submitted by John Stebbins. Thanks!

Modified:
   trunk/libdvdnav/src/dvdnav.c

Modified: trunk/libdvdnav/src/dvdnav.c
==============================================================================
--- trunk/libdvdnav/src/dvdnav.c	Sat Jul 31 01:34:08 2010	(r1205)
+++ trunk/libdvdnav/src/dvdnav.c	Sat Jul 31 01:34:11 2010	(r1206)
@@ -178,9 +178,9 @@ dvdnav_status_t dvdnav_reset(dvdnav_t *t
 #ifdef LOG_DEBUG
   fprintf(MSG_OUT, "libdvdnav: clearing dvdnav\n");
 #endif
+  pthread_mutex_unlock(&this->vm_lock);
   result = dvdnav_clear(this);
 
-  pthread_mutex_unlock(&this->vm_lock);
   return result;
 }
 


More information about the DVDnav-discuss mailing list