[libdvdnav-devel] [Git][videolan/libdvdread][master] 4 commits: dvdread: close the ifo file before reopening it for SAMG and ASVS
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Sat Jul 4 08:21:37 UTC 2026
Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdread
Commits:
8ab50502 by Saifelden Mohamed Ismail at 2026-07-02T22:18:02+03:00
dvdread: close the ifo file before reopening it for SAMG and ASVS
- - - - -
c1e02078 by Saifelden Mohamed Ismail at 2026-07-02T22:18:02+03:00
dvdread: read the ASVS ifo before its backup in ifoOpenASVS
- - - - -
7eaad91b by Saifelden Mohamed Ismail at 2026-07-02T22:18:02+03:00
dvdread: check the track table realloc in ifoRead_TIF
- - - - -
4c0fbd5a by Saifelden Mohamed Ismail at 2026-07-02T22:18:02+03:00
dvdread: null check the reader in DVDClose
- - - - -
2 changed files:
- src/dvd_reader.c
- src/ifo_read.c
Changes:
=====================================
src/dvd_reader.c
=====================================
@@ -857,10 +857,12 @@ dvd_reader_t *DVDOpenFiles( void *priv, const dvd_logger_cb *logcb,
void DVDClose( dvd_reader_t *dvd )
{
if( dvd ) {
- if( dvd->rd->dev ) dvdinput_close( dvd->rd->dev );
- if( dvd->rd->path_root ) free( dvd->rd->path_root );
- if( dvd->rd->udfcache ) FreeUDFCache( dvd->rd->udfcache );
- free( dvd->rd );
+ if( dvd->rd ) {
+ if( dvd->rd->dev ) dvdinput_close( dvd->rd->dev );
+ if( dvd->rd->path_root ) free( dvd->rd->path_root );
+ if( dvd->rd->udfcache ) FreeUDFCache( dvd->rd->udfcache );
+ free( dvd->rd );
+ }
if (dvd->fs) {
dvd->fs->close(dvd->fs);
}
=====================================
src/ifo_read.c
=====================================
@@ -472,6 +472,7 @@ static ifo_handle_t *ifoOpenFileOrBackup(dvd_reader_t *ctx, int title,
goto ifoOpen_fail;
/* Should read SAMG as it contains location to AOB pointers */
+ DVDCloseFile(ifop->file);
ifop->file = DVDOpenFile(ctx, 2, DVD_READ_SAMG_INFO);
if(!ifop->file)
goto ifoOpen_fail;
@@ -479,6 +480,7 @@ static ifo_handle_t *ifoOpenFileOrBackup(dvd_reader_t *ctx, int title,
goto ifoOpen_fail;
/* The Audio Still Video Set (ASVS) is optional, though usually exists */
+ DVDCloseFile(ifop->file);
ifop->file = DVDOpenFile(ctx, 2, backup ? DVD_READ_ASVS_INFO_BACKUP
: DVD_READ_ASVS_INFO);
if(!ifop->file)
@@ -672,8 +674,8 @@ ifo_handle_t *ifoOpenASVS(dvd_reader_t *ctx) {
if(!ifop)
return NULL;
- const dvd_read_domain_t domain = backup ? DVD_READ_ASVS_INFO
- : DVD_READ_ASVS_INFO_BACKUP;
+ const dvd_read_domain_t domain = backup ? DVD_READ_ASVS_INFO_BACKUP
+ : DVD_READ_ASVS_INFO;
const char *ext = backup ? "BUP" : "IFO";
ifop->ctx = ctx;
@@ -1253,7 +1255,9 @@ int ifoRead_TIF(ifo_handle_t *ifofile, int sector_offset) {
/* the second table is an audio_ts only table, the first is audio_ts, video_ts, strangly the nr_titles in second table doesnt match up with the true nr_titles for this table. Need to subtract video titles*/
for(int i=0; i<tracks_info_table->nr_of_titles; i++) {
if(tracks_info_table->tracks_info[i].type_and_rank==0 && sector_offset == 2) {
- tracks_info_table->tracks_info = realloc(tracks_info_table->tracks_info, i * sizeof(track_info_t));
+ track_info_t *resized = realloc(tracks_info_table->tracks_info, i * sizeof(track_info_t));
+ if(resized || i == 0)
+ tracks_info_table->tracks_info = resized;
tracks_info_table->nr_of_titles = i;
break;
}
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/5387735ea66d76624f9c421b29f4167fc6f1abff...4c0fbd5aea3d619fa06f084c06b304f71dcc5fc4
--
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/5387735ea66d76624f9c421b29f4167fc6f1abff...4c0fbd5aea3d619fa06f084c06b304f71dcc5fc4
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the libdvdnav-devel
mailing list