I am currently working on a school assignment where I have to build a quadtree out of a picture's color variation. 
I have trouble as when I compile, everything's fine, only, when I execute, I get a segmentation fault. I've ran gdband backtrace to check where my errors could be. 
Edit 2: After following the corrections given by Barmar.
Program received signal SIGSEGV, Segmentation fault.
0x0000000000401227 in give_moments (picture=0x21ec010, x_min=0, y_min=0, x_max=255, y_max=255,
    moment_o0=0x400ace <create_quadtree+18>, moment_o1=0x400000000, moment_o2=0x21ec010) at image_utile.c:89
89         *moment_o0 = number_pix;
(gdb) bt
#0  0x0000000000401227 in give_moments (picture=0x21ec010, x_min=0, y_min=0, x_max=255, y_max=255,
    moment_o0=0x400ace <create_quadtree+18>, moment_o1=0x400000000, moment_o2=0x21ec010) at image_utile.c:89
#1  0x0000000000400be5 in recursive_node (picture=0x21ec010, limit=100, tree=0x21ec050, x_min=0, x_max=255, y_min=0,
    y_max=255) at quadtree.c:126
#2  0x0000000000400e48 in split_image (picture=0x21ec010, limit=100) at quadtree.c:162
Edit 1: Here is the give_moments() function.
extern void give_moments(image picture, int x_min, int y_min, int x_max, int y_max,
                         double *moment_o0, double *moment_o1, double *moment_o2) {
    /* Moment order 0 declarations. */
    double number_pix;
    /* Moment order 1 declarations. */
    unsigned char composants1[] = { 0, 0, 0 };
    double moment1[] = { 0, 0, 0 };
    int i, j, m;
    /* Moment order 2 declarations. */
    unsigned char composants2[] = { 0, 0, 0 };
    double moment2[] = { 0, 0, 0 };
    int k, l, n;
    /* Calculates moment order 0. */
    number_pix = (x_max - x_min + 1) * (y_max - y_min + 1);
    *moment_o0 = number_pix;
    /* Calculates moment order 1. */
    for (j = x_min; j < x_max; j++) {
        for (i = y_min; i < y_max; i++) {
            image_read_pixel(picture, i, j, composants1);
            moment1[0] += (double)composants1[0];
            if (image_give_dim(picture) == 3) {
                moment1[1] += (double)composants1[1];
                moment1[2] += (double)composants1[2];
            }
        } 
    }
    for (m = 0; m < 3; m++) {
        moment_o1[m] = moment1[m];
    }
    /* Calculates moment order 2. */
    for (l = x_min; l < x_max; l++) {
        for (k = y_min; k < y_max; k++) {
            image_read_pixel(picture, k, l, composants2);
            moment2[0] += (double)(composants2[0] * composants2[0]);
            if (image_give_dim(picture) == 3) {  
                moment2[1] += (double)composants2[1] * (double)composants2[1];
                moment2[2] += (double)composants2[2] * (double)composants2[2];
            }
        }
    } 
    for (n = 0; n < 3; n++) {
        moment_o2[n] = moment2[n];
    }
}
The give_moments() function entails the other following errors. But I can't find what's wrong with *moment_o0 = number_pix;.
Hopefully anyone could help me? I'd be so thankful!
 
    