Skip to content

Commit 96048ea

Browse files
committed
vfs: if mmap fails set mapped back to NULL
1 parent 5e988a9 commit 96048ea

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libretro-common/vfs/vfs_implementation.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,10 @@ libretro_vfs_implementation_file *retro_vfs_file_open_impl(
623623

624624
if ((stream->mapped = (uint8_t*)mmap((void*)0,
625625
stream->mapsize, PROT_READ, MAP_SHARED, stream->fd, 0)) == MAP_FAILED)
626+
{
627+
stream->mapped = NULL;
626628
stream->hints &= ~RETRO_VFS_FILE_ACCESS_HINT_FREQUENT_ACCESS;
629+
}
627630
}
628631
#endif
629632
}

0 commit comments

Comments
 (0)