aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorBrian Hinz <bphinz@users.sourceforge.net>2011-08-23 22:38:32 +0000
committerBrian Hinz <bphinz@users.sourceforge.net>2011-08-23 22:38:32 +0000
commit244ef4f23e7e694e85f7c4f96fe1bf163e412937 (patch)
tree085870c7fc8fa25b48d545d58daeb83471bd4b74 /java/src
parentde7a3c94b7d84d5824faa62f195481d18fe779ff (diff)
downloadtigervnc-244ef4f23e7e694e85f7c4f96fe1bf163e412937.tar.gz
tigervnc-244ef4f23e7e694e85f7c4f96fe1bf163e412937.zip
added sanity checks for setting jpeg quality level from command line
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4651 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/tigervnc/vncviewer/CConn.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/java/src/com/tigervnc/vncviewer/CConn.java b/java/src/com/tigervnc/vncviewer/CConn.java
index c715514f..b19266f0 100644
--- a/java/src/com/tigervnc/vncviewer/CConn.java
+++ b/java/src/com/tigervnc/vncviewer/CConn.java
@@ -691,7 +691,11 @@ public class CConn extends CConnection
}
options.noJpeg.setSelected(!viewer.noJpeg.getValue());
digit = 0 + viewer.qualityLevel.getValue();
- options.qualityLevel.setSelectedItem(digit);
+ if (digit >= 0 && digit <= 9) {
+ options.qualityLevel.setSelectedItem(digit);
+ } else {
+ options.qualityLevel.setSelectedItem(Integer.parseInt(viewer.qualityLevel.getDefaultStr()));
+ }
options.viewOnly.setSelected(viewer.viewOnly.getValue());
options.acceptClipboard.setSelected(viewer.acceptClipboard.getValue());