Skip to content

Commit

Permalink
fix [2448319] out of bounds array index in fog
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelflinger committed Feb 17, 2010
1 parent 5dca849 commit fa36f2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions include/private/pixelflinger/ggl_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions libpixelflinger/pixelflinger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fa36f2c

Please sign in to comment.