Commit 73bc38c3 authored by Ian Curtis's avatar Ian Curtis Committed by hpi1

BDGraphics: Fix reading outside of source image

parent f40311b6
......@@ -336,6 +336,14 @@ abstract class BDGraphicsBase extends Graphics2D implements ConstrainableGraphic
private void drawSpanN(int x, int y, int length, int src[], int srcOffset, boolean flipX) {
/* avoid overreading source */
if (srcOffset + length > src.length) {
length -= srcOffset + length - src.length;
}
if (length <= 0) {
return;
}
Rectangle rect = new Rectangle(x, y, length, 1);
rect = actualClip.intersection(rect);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment