Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix possible negative array index.
Check that our index is non-negative before using it in an array.
  • Loading branch information
Kyle Hill committed Sep 1, 2012
1 parent 3168206 commit bd3101f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xbmc/video/Teletext.cpp
Expand Up @@ -1662,7 +1662,7 @@ void CTeletextDecoder::Decode_ADIP() /* additional information table */
m_txtCache->ADIP_Pg[i] = 0; /* completely decoded: clear entry */
} /* next adip page i */

while (!m_txtCache->ADIP_Pg[m_txtCache->ADIP_PgMax] && (m_txtCache->ADIP_PgMax >= 0)) /* and shrink table */
while ((m_txtCache->ADIP_PgMax >= 0) && !m_txtCache->ADIP_Pg[m_txtCache->ADIP_PgMax]) /* and shrink table */
m_txtCache->ADIP_PgMax--;
}

Expand Down

0 comments on commit bd3101f

Please sign in to comment.