Blame SOURCES/qt-fix-crash-in-qppmhandler-for-certain-malformed-images.patch

80a0e2
diff --git a/src/gui/image/qppmhandler.cpp b/src/gui/image/qppmhandler.cpp
80a0e2
index 9cacfab2..6ab58b25 100644
80a0e2
--- a/src/gui/image/qppmhandler.cpp
80a0e2
+++ b/src/gui/image/qppmhandler.cpp
80a0e2
@@ -108,7 +108,7 @@ static bool read_pbm_header(QIODevice *device, char& type, int& w, int& h, int&
80a0e2
     else
80a0e2
         mcc = read_pbm_int(device);               // get max color component
80a0e2
 
80a0e2
-    if (w <= 0 || w > 32767 || h <= 0 || h > 32767 || mcc <= 0)
80a0e2
+    if (w <= 0 || w > 32767 || h <= 0 || h > 32767 || mcc <= 0 || mcc > 0xffff)
80a0e2
         return false;                                        // weird P.M image
80a0e2
 
80a0e2
     return true;