updatePixels(x,y,w,h) crashes when the region is smaller than the image
UpdatePixels() crashes with a "java.lang.ArrayIndexOutOfBoundException: length=1024; index=1024" error if the optional parameters are used and the defined region is smaller than the image. The above is with a 64x64 size PImage with updatePixels(0,0,32,32) as the argument. The error length and index numbers are always equal to the size of the pixels array.
Below is a small sketch that will crash in APDE with the above setup.
PImage p;
void setup(){
size(displayWidth,displayHeight,P3D);
p = createImage(64,64,ARGB);
}
void draw(){
p.loadPixels();
for(int i=0; i< p.pixels.length; i++){
p.pixels[i]=color(random(255));
}
p.updatePixels(0,0,32,32);
image(p,0,0,width, height);
}
This seems like a bug in Android mode. I do notice that your demo works correctly in the default renderer (JAVA2D) but not in any OpenGL-based renderers. I can look into this more later but it seems like your best bet would be to file an issue in the Android mode repo.