0cf76c6
diff -up qt-everywhere-opensource-src-4.8.7/src/gui/image/qppmhandler.cpp.me qt-everywhere-opensource-src-4.8.7/src/gui/image/qppmhandler.cpp
0cf76c6
--- qt-everywhere-opensource-src-4.8.7/src/gui/image/qppmhandler.cpp.me	2019-03-22 10:22:16.213800109 +0100
0cf76c6
+++ qt-everywhere-opensource-src-4.8.7/src/gui/image/qppmhandler.cpp	2019-03-22 10:22:40.721890281 +0100
0cf76c6
@@ -108,7 +108,7 @@ static bool read_pbm_header(QIODevice *d
0cf76c6
     else
0cf76c6
         mcc = read_pbm_int(device);               // get max color component
0cf76c6
 
0cf76c6
-    if (w <= 0 || w > 32767 || h <= 0 || h > 32767 || mcc <= 0)
0cf76c6
+    if (w <= 0 || w > 32767 || h <= 0 || h > 32767 || mcc <= 0 || mcc > 0xffff)
0cf76c6
         return false;                                        // weird P.M image
0cf76c6
 
0cf76c6
     return true;