Bug 1353625 - detect zero (0) as invalid resolution. r=bobowen a=jorgk DONTBUILD THUNDERBIRD540b3_2017053101_RELBRANCH
authorJorg K <jorgk@jorgk.com>
Tue, 30 May 2017 23:44:00 +0200
branchTHUNDERBIRD540b3_2017053101_RELBRANCH
changeset 394129 4ac128e4455e627c7566df000110cf6245a641cb
parent 394128 fe2592866f721f30b1a22b3a3102f66372d083f6
child 394141 fcf96d6690b4c1a5ba38717df41eb404168d9d6d
push id7371
push usermozilla@jorgk.com
push dateWed, 31 May 2017 21:40:40 +0000
treeherdermozilla-beta@4ac128e4455e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbobowen, jorgk
bugs1353625
milestone54.0
Bug 1353625 - detect zero (0) as invalid resolution. r=bobowen a=jorgk DONTBUILD
widget/nsPrintOptionsImpl.cpp
--- a/widget/nsPrintOptionsImpl.cpp
+++ b/widget/nsPrintOptionsImpl.cpp
@@ -507,17 +507,17 @@ nsPrintOptions::ReadPrefs(nsIPrintSettin
       // ones for letter. See bug 1276717.
       if (sizeUnit == nsIPrintSettings::kPaperSizeMillimeters &&
           height == 11L && width == 8.5L) {
 
         // As an extra precaution only override, when the resolution is also
         // set to the legacy invalid, uninitialized value. We'll just broadly
         // assume that anything outside of a million DPI is invalid.
         if (GETINTPREF(kPrintResolution, &iVal) &&
-            (iVal < 0 || iVal > 1000000)) {
+            (iVal <= 0 || iVal > 1000000)) {
           height = -1L;
           width = -1L;
         }
       }
 #endif
     }
 
     if (success) {