1 | initial version |
i think, your len is wrong:
len = sizeof(rgb_img->imageData);
since rgb_img->imageData is a pointer to uchar, sizeof(rgb_img->imageData) will give 4 on a 32 bit system, and 8 on 64 bit one. definitely not, what you wanted, right ?
the desired len is probably:
width * height * nChannels
here