Title says it all
Still not really sure it's a proper fix, but would need to look into the bug by self to give any sort of useful feedback.
Fixed it in a different way, by clamping. That's what actually should happen and it's implemented in USHORTTOUCHAR macro already. Not sure why we didn't use this macro before there.