[PR #3496] [MERGED] libkernel: Return EINVAL if mmap is called with length = 0 #3517

Closed
opened 2026-02-27 22:03:59 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3496
Author: @StevenMiller123
Created: 8/31/2025
Status: Merged
Merged: 8/31/2025
Merged by: @squidbus

Base: mainHead: mmap-fix


📝 Commits (1)

  • c27d29b Return EINVAL if mmap is called with length 0

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 src/core/libraries/kernel/memory.cpp (+6 -0)

📄 Description

Some multimedia apps will try mmap-ing files of size 0. Currently, shadPS4 will go to platform-level memory functions, and likely error there. On real hardware, this returns EINVAL like most other memory functions.

This PR fixes a memory error encountered by some multimedia apps that don't work on main yet.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3496 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 8/31/2025 **Status:** ✅ Merged **Merged:** 8/31/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `mmap-fix` --- ### 📝 Commits (1) - [`c27d29b`](https://github.com/shadps4-emu/shadPS4/commit/c27d29b47cf4a7b900109a5d4c902404af3caabe) Return EINVAL if mmap is called with length 0 ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/memory.cpp` (+6 -0) </details> ### 📄 Description Some multimedia apps will try mmap-ing files of size 0. Currently, shadPS4 will go to platform-level memory functions, and likely error there. On real hardware, this returns EINVAL like most other memory functions. This PR fixes a memory error encountered by some multimedia apps that don't work on main yet. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03:59 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3517
No description provided.