http://bugs.winehq.org/show_bug.cgi?id=21618
--- Comment #22 from Stefan Dösinger stefandoesinger@gmx.at 2010-02-08 03:56:41 --- the gl unmap works just fine, its the manual flushing that doesn't work - because the 2nd map try(that finally works) is done without GL_MAP_FLUSH_EXPLICIT_BIT. The error doesn't cause any troubles, but still my debug patch is not the right way to fix it.
The proper thing to do is (a) not to record dirty areas when doing readonly maps, and (b) not to pass GL_MAP_FLUSH_EXPLICIT_BIT when doing readonly maps. That should fix both the crash and the unmap errors. I'll attach a patch later.