From 340029f3338e667f76c2dbc5fc6d57fc4a4ddc2f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 17 Jan 2015 13:09:25 -0800 Subject: [PATCH] Avoid a bad buffer access on GE_PRIM_KEEP_PREVIOUS. --- GPU/Common/IndexGenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/Common/IndexGenerator.cpp b/GPU/Common/IndexGenerator.cpp index a46d9796f8..5413e7f410 100644 --- a/GPU/Common/IndexGenerator.cpp +++ b/GPU/Common/IndexGenerator.cpp @@ -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_; }