Whenever something comes from an external source, be it a user input, a file, a URL, etc.,
always diligently parse that input whether it's in the format your code would expect it to be.
That is so b/c you don't have control over them.
Moreover, malicious attacks can try sending to your program a corrupt input
in order to crash and even take control of it!
In your case, in order to draw an ellipse(), you need at least 4 elements from an Array.
So, you gotta refuse any Array w/ less than 4 elements in it!
if (data.length >= 4) ellipse(data[0], data[1], data[2], data[3]);
always diligently parse that input whether it's in the format your code would expect it to be.
That is so b/c you don't have control over them.
Moreover, malicious attacks can try sending to your program a corrupt input
in order to crash and even take control of it!
In your case, in order to draw an ellipse(), you need at least 4 elements from an Array.
So, you gotta refuse any Array w/ less than 4 elements in it!
if (data.length >= 4) ellipse(data[0], data[1], data[2], data[3]);