What is the program doing wrong?
You've got a mutex on thread 2 but don't you need one on thread 1 as well? What's to stop threads 1&2 operating on the same bit of memory?
What is the significance of 4136 (in the memset call)? If sizeof(struct CaptureBuffer)==4136, why not use sizeof(struct CaptureBuffer) instead, and if it isn't, what do you think will happen?
4136*100000 = 413 600 000 not counting other memory needed for pointers and such. Does your program have over 394MB to play with?