From 300406abd4a1e96d18d2a6486b3e41ddd3cee8b4 Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Sun, 16 Jan 2011 14:54:28 -0800 Subject: Add some error checking. Change-Id: I007b1429a64b39ffd5cdef200c295d5a31f95048 --- libs/rs/rsThreadIO.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libs/rs/rsThreadIO.cpp') diff --git a/libs/rs/rsThreadIO.cpp b/libs/rs/rsThreadIO.cpp index 1c6c5ac426bb..001ac5529e20 100644 --- a/libs/rs/rsThreadIO.cpp +++ b/libs/rs/rsThreadIO.cpp @@ -53,6 +53,10 @@ bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand) { waitForCommand = false; //LOGV("playCoreCommands 3 %i %i", cmdID, cmdSize); + if (cmdID >= (sizeof(gPlaybackFuncs) / sizeof(void *))) { + rsAssert(cmdID < (sizeof(gPlaybackFuncs) / sizeof(void *))); + LOGE("playCoreCommands error con %p, cmd %i", con, cmdID); + } gPlaybackFuncs[cmdID](con, data); mToCore.next(); } -- cgit v1.2.3-59-g8ed1b