mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-02-21 16:43:35 +00:00
Bounds check on bitmap add.
This commit is contained in:
parent
1fac9dc29b
commit
d4b9a6378f
1 changed files with 6 additions and 0 deletions
|
@ -24,6 +24,12 @@
|
||||||
|
|
||||||
public void Add(int cbIndex, int offset, int size)
|
public void Add(int cbIndex, int offset, int size)
|
||||||
{
|
{
|
||||||
|
// Some usages can be out of bounds (vertex buffer on amd), so bound if necessary.
|
||||||
|
if (offset + size > _size)
|
||||||
|
{
|
||||||
|
size = _size - offset;
|
||||||
|
}
|
||||||
|
|
||||||
int cbBase = cbIndex * _bitsPerCb;
|
int cbBase = cbIndex * _bitsPerCb;
|
||||||
int start = cbBase + offset / _granularity;
|
int start = cbBase + offset / _granularity;
|
||||||
int end = cbBase + (offset + size - 1) / _granularity;
|
int end = cbBase + (offset + size - 1) / _granularity;
|
||||||
|
|
Loading…
Reference in a new issue