If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

What's the type of pHosBuffRame? I assume it's unsigned char (or BYTE). If so, you want to break this complex expressions into individual steps that can be debugged easily. First, calculate the correct address:

Once you've verified that both temps have the right values, call memset.
In the meantime, you can comment out the memset call and see if it stops the crashes (the program shouldn't produce correct output but the aim is to locate the line that causes the crash).