why is it causing segmentation fault while I run it?

struct pixel **read_pixel_array(FILE *image, int pixel_array_offset, int width, int height) {

        struct pixel ** my_pixels = malloc(sizeof(struct pixel *) * height);
        // initialize it to point for an entire row of pixel data
        for(int i = 0; i < height; i++){
                my_pixels[i] = malloc(sizeof(struct pixel *) * width);
        }

        // fill it with data
        //
        fseek(image, pixel_array_offset, SEEK_SET);
        int val = fread(my_pixels, sizeof(struct pixel), height*width, image);
        printf("%d\n", val);
        return my_pixels;
}