I seems I'm unable to replicate the download of the liveview image on my 7D (the jpeg file is 0ko and I get the same access violation at the end of downloadLiveData.

Could you please post the full function to a site like Pastebin.com - #1 paste tool since 2002! (it preserves the formating) ?