Mercurial > libdvdnav.hg
comparison dvdread/dvd_reader.c @ 340:eea1e72ea1dd src
in DVDDiscID() call DVDCloseFile() before exiting with an error ; patch by Erik Hovland - erik hovland org
author | nicodvb |
---|---|
date | Sat, 19 Apr 2008 10:27:37 +0000 |
parents | 63aad8298f28 |
children | 5b8539cacebf |
comparison
equal
deleted
inserted
replaced
339:d0bfcfa565b0 | 340:eea1e72ea1dd |
---|---|
1115 size_t file_size = dvd_file->filesize * DVD_VIDEO_LB_LEN; | 1115 size_t file_size = dvd_file->filesize * DVD_VIDEO_LB_LEN; |
1116 char *buffer_base = malloc( file_size + 2048 ); | 1116 char *buffer_base = malloc( file_size + 2048 ); |
1117 char *buffer = (unsigned char *)(((uintptr_t)buffer_base & ~((uintptr_t)2047)) + 2048); | 1117 char *buffer = (unsigned char *)(((uintptr_t)buffer_base & ~((uintptr_t)2047)) + 2048); |
1118 | 1118 |
1119 if( buffer_base == NULL ) { | 1119 if( buffer_base == NULL ) { |
1120 DVDCloseFile( dvd_file ); | |
1120 fprintf( stderr, "libdvdread: DVDDiscId, failed to " | 1121 fprintf( stderr, "libdvdread: DVDDiscId, failed to " |
1121 "allocate memory for file read!\n" ); | 1122 "allocate memory for file read!\n" ); |
1122 return -1; | 1123 return -1; |
1123 } | 1124 } |
1124 bytes_read = DVDReadBytes( dvd_file, buffer, file_size ); | 1125 bytes_read = DVDReadBytes( dvd_file, buffer, file_size ); |