I get a segfault from this line of code:
int fatblob[1820][286][5];
Why is that?
Because your stack segment is smaller then 1820*285*5 ints. It's usually in a neighborhood of 1MB.
1820*285*5
int