Commit 317d4112 authored by Petri Hintukainen's avatar Petri Hintukainen

BDGraphics.drawImageN(): limit source rectangle to source image

parent f4e4bd79
- Fix out of array bounds exception in some BD-J menus
2013-05-27: Version 0.6.0
- Improved BD-J support (Most BD-J discs are correctly played).
- Mark BD-J titles supported in BLURAY_DISC_INFO if BD-J is functional.
......
......@@ -1037,6 +1037,14 @@ abstract class BDGraphicsBase extends Graphics2D implements ConstrainableGraphic
if (dw < 0) dw = bdImage.width;
if (dh < 0) dh = bdImage.height;
/* limit source rectangle width / height to source image */
if (sx + sw > bdImage.width) {
sw = bdImage.width - sx;
}
if (sy + sh > bdImage.height) {
sh = bdImage.height - sy;
}
int stride = bdImage.width;
int[] rgbArray = bdImage.getBdBackBuffer();
int bgColor = 0;
......
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