Nice!
Structure is more of a style thing, don't worry too much about this.
About the bad pixel list, you don't know in advance how many bad pixels you have. So, you need to check if you still have space in the array before inserting a new item (otherwise you get a buffer overflow - of course, only when you will have more than 1000 pixels). You can use the COUNT() macro for this.
Also, it's clearer to start the counter from 0, not from -1 (so it always represents the number of items you have in the array, not N-1).