[libdvdnav-devel] [Git][videolan/libdvdread][master] 2 commits: Use correct size path buffer
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Tue Aug 11 20:23:21 UTC 2026
Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdread
Commits:
788a5afd by Petri Hintukainen at 2026-08-11T22:49:35+03:00
Use correct size path buffer
All other places use PATH_MAX.
- - - - -
60ee58f2 by Petri Hintukainen at 2026-08-11T22:53:14+03:00
Simplify
Also fixes uninitialized filename when backup is not 0 or 1.
- - - - -
1 changed file:
- src/dvd_reader.c
Changes:
=====================================
src/dvd_reader.c
=====================================
@@ -1053,19 +1053,9 @@ static uint8_t *cppm_get_mkb_or_backup( dvd_reader_t *ctx, int backup )
{
uint8_t* p_mkb;
dvd_file_t* mkb_file;
- char filename[ MAX_UDF_FILE_NAME_LEN ];
+ const char *filename = backup ? "/AUDIO_TS/DVDAUDIO.BUP" : "/AUDIO_TS/DVDAUDIO.MKB";
dvd_reader_device_t *dvd = ctx->rd;
- switch( backup )
- {
- case 0:
- strcpy( filename, "/AUDIO_TS/DVDAUDIO.MKB" );
- break;
- case 1:
- strcpy( filename, "/AUDIO_TS/DVDAUDIO.BUP" );
- break;
- }
-
uint32_t len;
/* exits early if there is no MKB file */
@@ -1075,8 +1065,9 @@ static uint8_t *cppm_get_mkb_or_backup( dvd_reader_t *ctx, int backup )
mkb_file= DVDOpenFileUDF( ctx, filename, 0 );
} else
{
- if( !findDVDFile( ctx, filename, filename ) ) return NULL;
- mkb_file= DVDOpenFilePath( ctx, filename );
+ char full_path[ PATH_MAX + 1 ];
+ if( !findDVDFile( ctx, filename, full_path ) ) return NULL;
+ mkb_file= DVDOpenFilePath( ctx, full_path );
}
if ( !mkb_file )
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/f1e207f51b9e0a916a2030dce6d27e44056c7f8f...60ee58f249d6050e05e1ad3f0eb2d8fcbdd12fe7
--
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/f1e207f51b9e0a916a2030dce6d27e44056c7f8f...60ee58f249d6050e05e1ad3f0eb2d8fcbdd12fe7
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