[DVDnav-discuss] [PATCH] do not close file twice

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Nov 6 19:25:09 CET 2012


There is another close further down that will always be reached.
Current code will result in a double close.

Index: vm/vm.c
===================================================================
--- vm/vm.c	(revision 1243)
+++ vm/vm.c	(working copy)
@@ -176,7 +176,6 @@
       off = lseek( fd, 32 * (off_t) DVD_VIDEO_LB_LEN, SEEK_SET );
       if( off == ( 32 * (off_t) DVD_VIDEO_LB_LEN ) ) {
         off = read( fd, data, DVD_VIDEO_LB_LEN );
-        close(fd);
         if (off == ( (off_t) DVD_VIDEO_LB_LEN )) {
           fprintf(MSG_OUT, "libdvdnav: DVD Title: ");
           for(i=25; i < 73; i++ ) {



More information about the DVDnav-discuss mailing list