EDIT: SOLVED PROBLEM THANKS ANYWAY
I keep getting a seg_fault .. I am certain it has to do with my setting 'processed_pixels' array to some value ..
heres the gdb debug entry
Ive commented out some code and simplified to help me find the error but I can't quite find it.
Program received signal SIGSEGV, Segmentation fault.
0x08048cbd in set_bg_processed (png_rows=0x8051000, processed_pixels=0x1)
95 processed_pixels[i][pixel_j] = 1;
char **processed_pixels = malloc(img_height * sizeof(char*));
processed_pixels[i] = calloc(stride, 1);
i am new to C
void set_bg_processed(png_bytepp png_rows, char **processed_pixels)
if( 1 ) //condition code elided, still seg_faults
int pixel_j = j / channels;
printf("debug: setting %d %d to processed ... \n ",i, pixel_j);
assert( pixel_j >= 0); // asserting pixel_j so it can be shown that it is positive here on the forum wihout showing 'channels' code
processed_pixels[i][pixel_j] = 1;
I think it crashes on i=0, pixel_j = 0
Thanks for helping!