Blob Blame History Raw
diff -rupN --no-dereference poppler-21.01.0/poppler/JPXStream.cc poppler-21.01.0-new/poppler/JPXStream.cc
--- poppler-21.01.0/poppler/JPXStream.cc	2021-01-02 17:54:42.000000000 +0100
+++ poppler-21.01.0-new/poppler/JPXStream.cc	2021-01-11 20:36:51.815824248 +0100
@@ -912,6 +912,10 @@ bool JPXStream::readCodestream(unsigned
                 error(errSyntaxError, getPos(), "Different number of components in JPX SIZ marker segment");
                 return false;
             }
+            if (img.nComps == 0) {
+                error(errSyntaxError, getPos(), "Invalid number of components in JPX SIZ marker segment");
+                return gFalse;
+            }
             if (img.xSize == 0 || img.ySize == 0 || img.xOffset >= img.xSize || img.yOffset >= img.ySize || img.xTileSize == 0 || img.yTileSize == 0 || img.xTileOffset > img.xOffset || img.yTileOffset > img.yOffset
                 || img.xTileSize + img.xTileOffset <= img.xOffset || img.yTileSize + img.yTileOffset <= img.yOffset) {
                 error(errSyntaxError, getPos(), "Error in JPX SIZ marker segment");