scummvm/scummvm — pull request #457 by fingolfin (2014-03-30 17:51:02+00:00)
Title: SCUMM: Avoid potential issues casting invalid values to enum

A compiler could in principle decide that a ResType enum can
never equal 0xFF or 0xFFFF, and thus incorrectly optimize
the ScummEngine::saveOrLoad code. So check the value
*before* casting it.