Avoid a bad buffer access on GE_PRIM_KEEP_PREVIOUS.

This commit is contained in:
Unknown W. Brackets committed 2015-01-17 18:43:01 -08:00
1 parent eaa4743285
commit 340029f333
1 file changed
+2 -2
+2 -2
View File
@@ -40,13 +40,13 @@ void IndexGenerator::Reset() {
}
bool IndexGenerator::PrimCompatible(int prim1, int prim2) {
if (prim1 == -1)
if (prim1 == GE_PRIM_INVALID || prim2 == GE_PRIM_KEEP_PREVIOUS)
return true;
return indexedPrimitiveType[prim1] == indexedPrimitiveType[prim2];
}
bool IndexGenerator::PrimCompatible(int prim) const {
if (prim_ == GE_PRIM_INVALID)
if (prim_ == GE_PRIM_INVALID || prim == GE_PRIM_KEEP_PREVIOUS)
return true;
return indexedPrimitiveType[prim] == prim_;
}