fix [2448319] out of bounds array index in fog
This commit is contained in:
parent
5dca849345
commit
fa36f2c3b7
2 changed files with 2 additions and 2 deletions
|
|
@ -285,8 +285,7 @@ struct clear_state_t {
|
|||
};
|
||||
|
||||
struct fog_state_t {
|
||||
uint8_t color[3];
|
||||
uint8_t reserved;
|
||||
uint8_t color[4];
|
||||
};
|
||||
|
||||
struct logic_op_state_t {
|
||||
|
|
|
|||
|
|
@ -281,6 +281,7 @@ static void ggl_fogColor3xv(void* con, const GGLclampx* color)
|
|||
const int32_t r = gglClampx(color[0]);
|
||||
const int32_t g = gglClampx(color[1]);
|
||||
const int32_t b = gglClampx(color[2]);
|
||||
c->state.fog.color[GGLFormat::ALPHA]= 0xFF; // unused
|
||||
c->state.fog.color[GGLFormat::RED] = (r - (r>>8))>>8;
|
||||
c->state.fog.color[GGLFormat::GREEN]= (g - (g>>8))>>8;
|
||||
c->state.fog.color[GGLFormat::BLUE] = (b - (b>>8))>>8;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue