diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index 7feb670528..6f4a73a487 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -30,6 +30,7 @@ #define ATRAC_ERROR_API_FAIL 0x80630002 #define ATRAC_ERROR_ALL_DATA_DECODED 0x80630024 #define ATRAC_ERROR_SECOND_BUFFER_NOT_NEEDED 0x80630022 +#define ATRAC_ERROR_INCORRECT_READ_SIZE 0x80630013 #define AT3_MAGIC 0x0270 #define AT3_PLUS_MAGIC 0xFFFE @@ -480,6 +481,8 @@ int sceAtracSetDataAndGetID(u32 buffer, u32 bufferSize) int sceAtracSetHalfwayBufferAndGetID(u32 halfBuffer, u32 readSize, u32 halfBufferSize) { ERROR_LOG(HLE, "UNIMPL sceAtracSetHalfwayBufferAndGetID(%08x, %08x, %08x)", halfBuffer, readSize, halfBufferSize); + if (readSize > halfBufferSize) + return ATRAC_ERROR_INCORRECT_READ_SIZE; int codecType = getCodecType(halfBuffer); Atrac *atrac = new Atrac();