Okay, new tests:
First, return the EndFrame line back to normal. Verify that it still crashes.
Test #1
Update your gfx drivers and check to see if it still crashes. Might be a driver issue.
Test #2
Go into Graphics.cpp and put // before lines 260-276. Verify that it still crashes (it should I think).