Fix negative value inside tonemap

It should be checked before but since it's not always reproducible.