Commit c3f1a56c authored by Steve Dibb's avatar Steve Dibb Committed by Jean-Baptiste Kempf

libdvdread: src/ifo_read.c Fix off-by-one error on displaying IFO filename

Fixes incorrect warning:

libdvdread: Invalid IFO for title 2 (VTS_02_0.BU).

to:

libdvdread: Invalid IFO for title 2 (VTS_02_0.BUP).
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 0cd997af
......@@ -305,11 +305,9 @@ ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title) {
}
if (title)
snprintf(ifo_filename, 12, "VTS_%02d_0.%s", title, bup_file_opened ? "BUP" : "IFO");
snprintf(ifo_filename, 13, "VTS_%02d_0.%s", title, bup_file_opened ? "BUP" : "IFO");
else
snprintf(ifo_filename, 12, "VIDEO_TS.%s", bup_file_opened ? "BUP" : "IFO");
ifo_filename[12] = '\0';
snprintf(ifo_filename, 13, "VIDEO_TS.%s", bup_file_opened ? "BUP" : "IFO");
if(!ifofile->file) {
fprintf(stderr, "libdvdread: Can't open file %s.\n", ifo_filename);
......@@ -369,9 +367,9 @@ ifoOpen_try_bup:
ifofile->file = DVDOpenFile(dvd, title, DVD_READ_INFO_BACKUP_FILE);
if (title)
snprintf(ifo_filename, 12, "VTS_%02d_0.BUP", title);
snprintf(ifo_filename, 13, "VTS_%02d_0.BUP", title);
else
strncpy(ifo_filename, "VIDEO_TS.BUP", 12);
strncpy(ifo_filename, "VIDEO_TS.BUP", 13);
if (!ifofile->file) {
fprintf(stderr, "libdvdread: Can't open file %s.\n", ifo_filename);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment