BindFramebuffer screws up framebuffer_sRGB state
Using 270.41.19 on a GTX 260, binding or unbinding a framebuffer object when FRAMEBUFFER_SRGB is enabled sometimes (depending somehow on the state and buffer properties) causes subsequent operations to be performed as if FRAMEBUFFER_SRGB were disabled, even though glIsEnabled reports that it is still enabled. Disabling and then re-enabling FRAMEBUFFER_SRGB after such a binding resolves the issue.
I've attached a test program and a screenshot to demonstrate the problem. The program fills the window with medium gray (.5,.5,.5); the left half is drawn after changing the framebuffer binding with FRAMEBUFFER_SRGB enabled, and the right half is then drawn after disabling and re-enabling FRAMEBUFFER_SRGB. The left half is filled with (.5,.5,.5) (no conversion), whereas the right half is filled with the sRGB-converted value.
Compilation instructions and other notes are in the program's comments.