Fix integer overflow in heightfield sample buffer allocation
numRows * numCols was computed and used for the malloc() size in 32-bit
int arithmetic, so large height maps (e.g. around 65536x65536) could
wrap the product to a small or zero value, allocating a far too small
buffer while the sample-writing loop below still iterates the true
dimensions, causing a heap buffer overflow.
Store the samples in a std::vector<PxHeightFieldSample> instead of a
manually malloc'd/freed buffer: resize()/operator[] compute the byte
offsets in size_t internally, so the multiplication can no longer wrap,
and there's no manual free() (nor the destructor that existed only for
that) to forget on any future edit.
Pick-to: 6.12 6.11 6.8
Change-Id: Ib373baef3a53c1f4b3515d9deb94dafe4106d2a6
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>