Just converted all negative values and kept unsigned char* type to avoid too many modifications in the code.
6af30b68f0