[DVDnav-discuss] dvdnav_get_position: Fix mutex unlocking in case of error

Jean-Baptiste Kempf git at videolan.org
Sun Aug 31 19:51:36 CEST 2014


libdvdnav | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Aug 31 19:51:04 2014 +0200| [e225924870be20b03aa5e05b8bd1f524499fe722] | committer: Jean-Baptiste Kempf

dvdnav_get_position: Fix mutex unlocking in case of error

> http://git.videolan.org/gitweb.cgi/libdvdnav.git/?a=commit;h=e225924870be20b03aa5e05b8bd1f524499fe722
---

 src/searching.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/searching.c b/src/searching.c
index 74a16ee..93c7c2c 100644
--- a/src/searching.c
+++ b/src/searching.c
@@ -563,11 +563,11 @@ dvdnav_status_t dvdnav_get_position(dvdnav_t *this, uint32_t *pos,
     *len += cell->last_sector - cell->first_sector + 1;
   }
 
+  pthread_mutex_unlock(&this->vm_lock);
+
   if((signed)*pos == -1)
     return DVDNAV_STATUS_ERR;
 
-  pthread_mutex_unlock(&this->vm_lock);
-
   return DVDNAV_STATUS_OK;
 }
 



More information about the DVDnav-discuss mailing list