diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-04-18 04:13:25 +0200 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-04-18 23:48:00 +0200 |
| commit | ef760ee012a1a7a9d8997fecce4f0c9a7122e1bd (patch) | |
| tree | 1e97fada9f3c2a759a5d6b78353fee2ad051385b /Source/Core/VideoCommon/TextureCacheBase.cpp | |
| parent | 853cf4f8181dd0162e81ebcd61331d8765d089ca (diff) | |
Common/PointerWrap: Prevent reads/writes past the end of the buffer.
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 078abf10b1..b1c9ead97a 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -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. |
