[libbluray-devel] HScreenDimension: validate width and height
hpi1
git at videolan.org
Mon May 2 10:30:00 CEST 2016
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sat Apr 30 17:08:04 2016 +0300| [7ca870b0404723dcfdee94f4d3600d14a6bd6f44] | committer: hpi1
HScreenDimension: validate width and height
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=7ca870b0404723dcfdee94f4d3600d14a6bd6f44
---
src/libbluray/bdj/java/org/havi/ui/HScreenDimension.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/libbluray/bdj/java/org/havi/ui/HScreenDimension.java b/src/libbluray/bdj/java/org/havi/ui/HScreenDimension.java
index 51e556d..c72271b 100644
--- a/src/libbluray/bdj/java/org/havi/ui/HScreenDimension.java
+++ b/src/libbluray/bdj/java/org/havi/ui/HScreenDimension.java
@@ -21,11 +21,14 @@ package org.havi.ui;
public class HScreenDimension {
public HScreenDimension(float width, float height) {
- this.width = width;
- this.height = height;
+ setSize(width, height);
}
public void setSize(float width, float height) {
+ if (width < 0.0f)
+ width = 0.0f;
+ if (height < 0.0f)
+ height = 0.0f;
this.width = width;
this.height = height;
}
More information about the libbluray-devel
mailing list