We have casted 2d array:
struct pixel(*image_data)[width] = (struct pixel(*)[width])img->px;
- I didn't get how it casts and allocate memory?
where width:
unsigned width = img->size_x;
and struct image:
struct image {
uint16_t size_x;
uint16_t size_y;
struct pixel *px;
};
2nd question:
What is maximum value that width can hold?
3rd:
If we iterate image_data[x][y] where x and y are long then there is buffer overflow?