The scanner crashes after a short period during scan of a directory structure that contains around 50.000 audio, video and picture objects. The number of directory level varies between 3 and 6. The scan process crashes and reports buffer overflow.
The attached patch solves this, but it may not be the root cause of the problem. The string variables has been moved from the stack to the heap. A huge amount of variables or huge variables should not be located on the stack in recursive function calls.