not allocating enough array members for two pointers (for imginfo and IMG) causing writes beyond allocated memory in some cases.
not allocating enough array members for two pointers (for imginfo and IMG) causing writes beyond allocated memory in some cases.