Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa36f2c3 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

fix [2448319] out of bounds array index in fog

parent 5dca8493
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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 {
+1 −0
Original line number Diff line number Diff line
@@ -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;