diff --git a/source/common/textures/animlib.cpp b/source/common/textures/animlib.cpp index d9cdccc7d..c712ae2bf 100644 --- a/source/common/textures/animlib.cpp +++ b/source/common/textures/animlib.cpp @@ -188,6 +188,9 @@ static void renderframe(anim_t *anim, uint16_t framenumber, uint16_t *pagepointe while (frame--) offset += LittleShort(pagepointer[frame]); + if (offset >= anim->curlp->nBytes) + return; + uint8_t *ppointer = (uint8_t *)(pagepointer) + anim->curlp->nRecords*2 + offset + 4; if ((ppointer-4)[1])