Pixel out of bounds checking

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
sigonasr2 2022-05-30 14:48:49 -05:00
parent 9c118ff30c
commit 99d410f43e
5 changed files with 3 additions and 1 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 708 B

View File

@ -314,7 +314,9 @@ public class SigShare {
for (int y=(regionInfo/REGION_X_COUNT)*REGION_HEIGHT;y<(regionInfo/REGION_X_COUNT)*REGION_HEIGHT+REGION_HEIGHT;y++) { for (int y=(regionInfo/REGION_X_COUNT)*REGION_HEIGHT;y<(regionInfo/REGION_X_COUNT)*REGION_HEIGHT+REGION_HEIGHT;y++) {
int xx=0; int xx=0;
for (int x=(regionInfo%REGION_X_COUNT)*REGION_WIDTH;x<(regionInfo%REGION_X_COUNT)*REGION_WIDTH+REGION_WIDTH;x++) { for (int x=(regionInfo%REGION_X_COUNT)*REGION_WIDTH;x<(regionInfo%REGION_X_COUNT)*REGION_WIDTH+REGION_WIDTH;x++) {
if (xx<i.getWidth()&&yy<i.getHeight()) {
Panel.pixel[y*SCREEN_WIDTH+x]=i.getRGB(xx,yy); Panel.pixel[y*SCREEN_WIDTH+x]=i.getRGB(xx,yy);
}
xx++; xx++;
} }
yy++; yy++;