mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 18:19:43 +01:00
Fix INBOUNDS() check for Graphics::drawtile3()
The function was not actually checking the number that would end up being used to index the tiles3 vector, and as a result there could potentially be out-of-bounds indexing. But this is fixed now.
This commit is contained in:
parent
6704675189
commit
f544e95e85
1 changed files with 2 additions and 1 deletions
|
@ -685,13 +685,14 @@ void Graphics::drawtile2( int x, int y, int t )
|
||||||
|
|
||||||
void Graphics::drawtile3( int x, int y, int t, int off )
|
void Graphics::drawtile3( int x, int y, int t, int off )
|
||||||
{
|
{
|
||||||
|
t += off * 30;
|
||||||
if (!INBOUNDS(t, tiles3))
|
if (!INBOUNDS(t, tiles3))
|
||||||
{
|
{
|
||||||
WHINE_ONCE("drawtile3() out-of-bounds!")
|
WHINE_ONCE("drawtile3() out-of-bounds!")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SDL_Rect rect = { Sint16(x), Sint16(y), tiles_rect.w, tiles_rect.h };
|
SDL_Rect rect = { Sint16(x), Sint16(y), tiles_rect.w, tiles_rect.h };
|
||||||
BlitSurfaceStandard(tiles3[t+(off*30)], NULL, backBuffer, &rect);
|
BlitSurfaceStandard(tiles3[t], NULL, backBuffer, &rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::drawentcolours( int x, int y, int t)
|
void Graphics::drawentcolours( int x, int y, int t)
|
||||||
|
|
Loading…
Reference in a new issue