For issues like these you might want to make use of utilities like Valgrind or Electric-Fence in order to find potential error sources faster.
Upon debugging it says that it tried to access VRAM.
So it actually halted execution and entered the VS debugger? In that case you should be able to see what value VideoRAM has when execution halts. Does it look valid (you seem to be writing only 0 and 1 to it, so then it should never contain anything else)? If it doesn't you might be having problems with buffer overflows as Jsolo suggested.
Another potential error source would be concurrency, though I have no idea how you've structured your emulator, and it's impossible to say from the snippets of code pasted here. If you've got dependencies to a global variable in more than one thread and at least one of those threads is modifying the variable you'll typically want to make those pieces of code mutually exclusive from one another.
Nowhere in the program is VideoRAM being set to 1 by mistake
At which points do you set it to 1 on purpose though? Might that have happened sometime earlier during execution, and now you're looking at an old value of VideoRAM while VRAM has been freed?
are you sure it's not just uninitialized ... memory?
Only local variables (i.e. those allocated on the stack) are truly uninitialized in C++. A global or local static variable should contain a zero value if not explictly initialized.