From f4b507313b823d572033099d6429635b4eb914d1 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Tue, 4 Mar 2014 01:20:18 -0500 Subject: [PATCH] GIFTranslator: error if out of bounds Error out if we're trying to access an out-of-bounds array index (which should never happen, but let's check just in case.) --- src/add-ons/translators/gif/GIFLoad.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/add-ons/translators/gif/GIFLoad.cpp b/src/add-ons/translators/gif/GIFLoad.cpp index ff3d4563db..ce9bb30a89 100644 --- a/src/add-ons/translators/gif/GIFLoad.cpp +++ b/src/add-ons/translators/gif/GIFLoad.cpp @@ -388,6 +388,10 @@ GIFLoad::ReadGIFImageData() continue; } + // error out if we're trying to access an out-of-bounds index + if (fNextCode >= ENTRY_COUNT) + goto bad_end; + if (fTable[fNewCode] != NULL) { // exists in table