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

Check for malloc fail before setting buffer

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 05c4e138
......@@ -1445,7 +1445,6 @@ int DVDISOVolumeInfo( dvd_reader_t *dvd,
}
buffer_base = malloc( DVD_VIDEO_LB_LEN + 2048 );
buffer = (unsigned char *)(((uintptr_t)buffer_base & ~((uintptr_t)2047)) + 2048);
if( buffer_base == NULL ) {
fprintf( stderr, "libdvdread: DVDISOVolumeInfo, failed to "
......@@ -1453,6 +1452,8 @@ int DVDISOVolumeInfo( dvd_reader_t *dvd,
return -1;
}
buffer = (unsigned char *)(((uintptr_t)buffer_base & ~((uintptr_t)2047)) + 2048);
ret = InternalUDFReadBlocksRaw( dvd, 16, 1, buffer, 0 );
if( ret != 1 ) {
fprintf( stderr, "libdvdread: DVDISOVolumeInfo, failed to "
......
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