I need help with malloc() inside another function.
I\'m passing a pointer and size to the fu
This does not make sense :
if(alloc_pixels(input_image, bmp_image_size)==NULL)
alloc_pixels returns a signed char (ERROR or NO_ERROR) and you compare it to NULL (which is supposed to be used for pointers).
If you want input_image to be changed, you need to pass a pointer to it to alloc_pixels.
alloc_pixels signature would be the following:
signed char alloc_pixels(unsigned char **ptr, unsigned int size)
You would call it like this:
alloc_pixels(&input_image, bmp_image_size);
And the memory allocation
*ptr = malloc(size);