0xC0000005 means "access violation".
The most common cause of this being trying to dereference an invalid pointer, of which the typical case is a NULL pointer.

The first thing to do would be to...