Skip to content

Commit

Permalink
radeon_hd: Fix array bounds check in encoder_name_lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
lioncash authored and mmuman committed Sep 26, 2014
1 parent 2a5e33a commit 69acb96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/add-ons/accelerants/radeon_hd/encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1966,8 +1966,8 @@ encoder_output_lock(bool lock)
Write32(OUT, R600_SCRATCH_REG6, biosScratch6);
}


static const char* encoder_name_matrix[37] = {
static const uint32 ENCODER_NAME_MATRIX_SIZE = 37;
static const char* encoder_name_matrix[ENCODER_NAME_MATRIX_SIZE] = {
"NONE",
"Internal Radeon LVDS",
"Internal Radeon TMDS1",
Expand Down Expand Up @@ -2010,7 +2010,7 @@ static const char* encoder_name_matrix[37] = {

const char*
encoder_name_lookup(uint32 encoderID) {
if (encoderID <= sizeof(encoder_name_matrix))
if (encoderID < ENCODER_NAME_MATRIX_SIZE)
return encoder_name_matrix[encoderID];
else
return "Unknown";
Expand Down

0 comments on commit 69acb96

Please sign in to comment.