mirror of
https://github.com/zeldaret/oot.git
synced 2025-06-08 09:31:52 +00:00
Document SysCfb_GetFbPtr bug
This commit is contained in:
parent
db2c08a51f
commit
922389fd6b
1 changed files with 3 additions and 0 deletions
|
@ -141,6 +141,9 @@ void Graph_InitTHGA(GraphicsContext* gfxCtx) {
|
||||||
gfxCtx->overlayBuffer = pool->overlayBuffer;
|
gfxCtx->overlayBuffer = pool->overlayBuffer;
|
||||||
gfxCtx->workBuffer = pool->workBuffer;
|
gfxCtx->workBuffer = pool->workBuffer;
|
||||||
|
|
||||||
|
//! @bug fbIdx is a signed integer that can overflow into the negatives. When compiled with IDO, the remainder
|
||||||
|
//! operator will yield -1 for odd negative values of fbIdx (i.e. the same as C99 onwards).
|
||||||
|
//! This results in an out of bounds array access in SysCfb_GetFbPtr due to the negative index value.
|
||||||
gfxCtx->curFrameBuffer = SysCfb_GetFbPtr(gfxCtx->fbIdx % 2);
|
gfxCtx->curFrameBuffer = SysCfb_GetFbPtr(gfxCtx->fbIdx % 2);
|
||||||
gfxCtx->unk_014 = 0;
|
gfxCtx->unk_014 = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue