

V512 A call of the 'memset' function will lead to overflow of the buffer 'param->reserved'. This may have been the result of a failed code merge. Still, two assignments to the same memoryType address looks strange. Sce_off_t *regionStartOut, sce_off_t *regionEndOut)Īs you can guess from the LOG_SCE_DUMMY_IMPL name, the implementation of the sceKernelGetDirectMemoryType method will be changing.

sce_kernel_memory.cpp 55 int PS4API sceKernelGetDirectMemoryType(sce_off_t start, int *memoryType, V519 The '* memoryType' variable is assigned values twice successively.

Most likely you need to do a pointer check before dereferencing it: bool ELFMapper::validateHeader()Īuto &fileMemory = m_moduleData->m_fileMemory But no, this code invokes undefined behavior. After all, this reference will be used only if the pointer is valid. Secondly, the m_moduleData pointer is not modified.Īnother objection may be that using a reference is safe. Firstly, due to the while (false) condition, the loop is iterated exactly once. So there is no mistake here." This is not the case. And then in the do-while loop, this pointer is modified and can become a null pointer. In the fragment above, the m_moduleData pointer is first dereferenced, and then compared with nullptr in the do-while loop.Īttentive readers might object: "It maybe that a valid pointer is passed to function. dioFormat = RTAUDIO_FORMAT_FLOAT32 // m_fileMemory dioFormat = RTAUDIO_FORMAT_SINT16 Ĭase SCE_AUDIO_OUT_PARAM_FORMAT_FLOAT_MONO: AudioOut.cpp 137 static AudioProperties getAudioProperties(uint32_t param)Ĭase SCE_AUDIO_OUT_PARAM_FORMAT_S16_8CH_STD: V796 It is possible that 'break' statement is missing in switch statement. Let's move on to the errors and defects that the PVS-Studio analyzer managed to find in the first release of the GPCS4 project. Actually, at the time of publication of this article, v0.2.1 has already been released - the project is developing rapidly. I downloaded and checked the project's v0.1.0. The first release of GPCS4 took place at the end of April 2022. Nevertheless, the developer of the project is full of enthusiasm and continues to enhance the emulator. The game is far from perfect though, it runs at very low FPS and has graphical glitches. It was the first successful launch of a PS4 game on PC. However, the project has evolved rapidly, and in early 2020, the developers of GPCS4 managed to run a game on their emulator - We are Doomed. Initially, the author of the project intended to investigate the PS4 architecture. GPCS4 is a PlayStation 4 emulator written in C and C++.
