farbrausch/fr_public — pull request #15 by png85 (2012-04-25 15:44:42+00:00)
Title: More memory-related fixes

This pull request fixes 3 more possible memory-related problems in werkkzeug3:

* _util.cpp: Mismatching allocation/deallocation: 'hlet' is allocated as an array but deallocated with just delete.
* werkkzeug3/geneffectcubes.cpp: In 'Exec_Effect_Wirbeln()' there are two out-of-bounds accesses to the global 'wirbeln' array.
* First one is when the array gets initialized (firsttime = 1). The loop iterates over 0x10000 array entries while the array is defined to contain only 0x8000 structs; fixed this by replacing the hardcoded 0x10000 with the global 'wirbelcount' constant.
* The second one is a bit later into the same function when the '_count' parameter exceeds 'wirbelcount'; added an sVERIFY() call to make sure this doesn't happen.