I would constrain brightness to be within valid ranges (eg. 0 to 1023).
If that's for an analogWrite, make it 0...255.