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