mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 11:49:06 +00:00
Common/PointerWrap: Prevent reads/writes past the end of the buffer.
This commit is contained in:
parent
853cf4f818
commit
ef760ee012
4 changed files with 51 additions and 27 deletions
|
@ -459,6 +459,12 @@ void TextureCacheBase::SerializeTexture(AbstractTexture* tex, const TextureConfi
|
|||
// needing to allocate/free an extra buffer.
|
||||
u8* texture_data = p.DoExternal(total_size);
|
||||
|
||||
if (p.GetMode() == PointerWrap::MODE_MEASURE)
|
||||
{
|
||||
ERROR_LOG_FMT(VIDEO, "Couldn't acquire {} bytes for serializing texture.", total_size);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!skip_readback)
|
||||
{
|
||||
// Save out each layer of the texture to the pointer.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue