GS/HW: Prevent out of bounds copy in OI_BlitFMV()

This commit is contained in:
Stenzek authored and refractionpcsx2 committed 2023-02-25 08:18:34 +00:00
1 parent 1eaec773e2
commit 520a369872
3 files changed
+5 -1

No files matched your search

+1
View File
@@ -88,6 +88,7 @@ public:
int GetWidth() const { return m_size.x; }
int GetHeight() const { return m_size.y; }
GSVector2i GetSize() const { return m_size; }
GSVector4i GetRect() const { return GSVector4i(m_size).zwxy(); }
int GetMipmapLevels() const { return m_mipmap_levels; }
bool IsMipmap() const { return m_mipmap_levels > 1; }
+1 -1
View File
@@ -4560,7 +4560,7 @@ bool GSRendererHW::OI_BlitFMV(GSTextureCache::Target* _rt, GSTextureCache::Sourc
// Copy back the texture into the GS mem. I don't know why but it will be
// reuploaded again later
m_tc->Read(tex, r_texture);
m_tc->Read(tex, r_texture.rintersect(tex->m_texture->GetRect()));
m_tc->InvalidateVideoMemSubTarget(_rt);
+3
View File
@@ -2830,6 +2830,9 @@ void GSTextureCache::Read(Target* t, const GSVector4i& r)
void GSTextureCache::Read(Source* t, const GSVector4i& r)
{
if (r.rempty())
return;
const GSVector4i drc(0, 0, r.width(), r.height());
if (!PrepareDownloadTexture(drc.z, drc.w, GSTexture::Format::Color, &m_color_download_texture))