Illegal color values are not handled gracefully
SanityCh3ck opened this issue ยท 1 comments
... and I have the crash report to prove it:
http://pastebin.com/Db3qHkCf
The following code, given an appropriately placed display module, will crash like that.
MOV 255 UP
MOV 2 UP
MOV 2 UP
MOV 8 UP
MOV 8 UP
I think the problem is
- masking the value with 0xFF here and casting it can produce negative byte values. Wouldn't just casting and letting it overflow do the same?
- the
%
operator used here actually being the remainder, not the modulus. This will produce negative results for negative inputs.
I'm using v0.5.0.37 for MC 1.7.10