mirror of https://github.com/mgba-emu/mgba.git
VFS: VFileFromFD should not open directories
This commit is contained in:
parent
4e4a266d53
commit
2dc729f17a
1
CHANGES
1
CHANGES
|
@ -31,6 +31,7 @@ Bugfixes:
|
||||||
- GBA BIOS: Fix ArcTan2 accuracy and boundary conditions
|
- GBA BIOS: Fix ArcTan2 accuracy and boundary conditions
|
||||||
- SDL: Fix sporadic crash when deinitializing audio
|
- SDL: Fix sporadic crash when deinitializing audio
|
||||||
- GBA Audio: Reset audio FIFO DMA if an invalid destination is set
|
- GBA Audio: Reset audio FIFO DMA if an invalid destination is set
|
||||||
|
- VFS: VFileFromFD should not open directories
|
||||||
Misc:
|
Misc:
|
||||||
- GBA: Slightly optimize GBAProcessEvents
|
- GBA: Slightly optimize GBAProcessEvents
|
||||||
- Qt: Add preset for DualShock 4
|
- Qt: Add preset for DualShock 4
|
||||||
|
|
|
@ -52,6 +52,12 @@ struct VFile* VFileFromFD(int fd) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct stat stat;
|
||||||
|
if (fstat(fd, &stat) < 0 || S_ISDIR(stat.st_mode)) {
|
||||||
|
close(fd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
struct VFileFD* vfd = malloc(sizeof(struct VFileFD));
|
struct VFileFD* vfd = malloc(sizeof(struct VFileFD));
|
||||||
if (!vfd) {
|
if (!vfd) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue