Blob Blame History Raw
diff -rupN --no-dereference poppler-22.08.0/poppler/JPXStream.cc poppler-22.08.0-new/poppler/JPXStream.cc
--- poppler-22.08.0/poppler/JPXStream.cc	2022-08-01 23:11:55.000000000 +0200
+++ poppler-22.08.0-new/poppler/JPXStream.cc	2022-08-03 15:38:40.363056246 +0200
@@ -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");