]> source.dussan.org Git - tigervnc.git/commitdiff
added sanity checks for setting jpeg quality level from command line
authorBrian Hinz <bphinz@users.sourceforge.net>
Tue, 23 Aug 2011 22:38:32 +0000 (22:38 +0000)
committerBrian Hinz <bphinz@users.sourceforge.net>
Tue, 23 Aug 2011 22:38:32 +0000 (22:38 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4651 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/src/com/tigervnc/vncviewer/CConn.java

index c715514ff93550b3e70ba2bca67e84e6550828d8..b19266f0963b01a10d8d5e78569f497563f7121f 100644 (file)
@@ -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());