From 1e37e875efa2adfb93c86d4d1dcdf097b12be12e Mon Sep 17 00:00:00 2001 From: Alex Sakhartchouk Date: Tue, 20 Jul 2010 10:59:25 -0700 Subject: [PATCH] Fixing potential buffer overrun errors. Change-Id: I77c43f0dd3a5d5a54465ff5d562f8e2b4d7fa3c3 --- libs/rs/rsType.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/rs/rsType.cpp b/libs/rs/rsType.cpp index 52e0d52efa40a..79cfd412c1453 100644 --- a/libs/rs/rsType.cpp +++ b/libs/rs/rsType.cpp @@ -145,6 +145,10 @@ uint32_t Type::getLODOffset(uint32_t lod, uint32_t x, uint32_t y, uint32_t z) co void Type::makeGLComponents() { + if(getElement()->getFieldCount() >= RS_MAX_ATTRIBS) { + return; + } + uint32_t userNum = 0; for (uint32_t ct=0; ct < getElement()->getFieldCount(); ct++) {