sizeof(char) or sizeof(unsigned char) is ALWAYS 1. So you've done nothing.

As the first poster said, condense it down.



huepix = malloc(info.width*sizeof(float));
memset(huepix, 0,...