Permalink
Browse files

CREImporter::SetupColor: fixed oob read

coverity 4432
  • Loading branch information...
lynxlynxlynx committed Aug 8, 2013
1 parent 23aa865 commit d143422aa1247cc10acee6b3d87a9a98279f81fd
Showing with 2 additions and 2 deletions.
  1. +2 −2 gemrb/plugins/CREImporter/CREImporter.cpp
@@ -896,13 +896,13 @@ void CREImporter::SetupColor(ieDword &stat)
int i;
for (i=(int) stat;i>=0;i--) {
if (randcolors[i][0]==stat) {
- stat=randcolors[i][ rand()%RandRows + 1];
+ stat=randcolors[i][rand()%RandRows];
return;
}
}
for (i=(int) stat+1;i<RandColor;i++) {
if (randcolors[i][0]==stat) {
- stat=randcolors[i][ rand()%RandRows + 1];
+ stat=randcolors[i][rand()%RandRows];
return;
}
}

0 comments on commit d143422

Please sign in to comment.