Good catch by bithub, you should check to ensure x doesn't exceed 600. Note, instead of using a literal 600, define constants
Code:
#define MAX_X    600
#define MAX_Y    480
Then, if you want to change your code to work with different size images, it's only two small changes in one place, instead of dozens in several places.

It could be your compiler, but not in the "it's a bug" sense, rather the "you're compiling with the wrong settings" sense. What compiler are you using? It doesn't look like GCC, so I can't be of much help.

Did you fix the declaration of main like I suggested, add a return value and remove the unnecessary line? If not, do so. It probably wont fix the problem, but it ought to be done anyway. Also, try moving the definition of array up with the other variables. It's possible your compiler doesn't like mixed statements and declarations.

Lastly, you need to check the return value of fopen to make sure it's not NULL before you proceed. No point in trying to read from a file you can't open. Add this immediately after the fopen call:
Code:
if (HUG == NULL) {
    perror("fopen");
    return EXIT_FAILURE;
}