Blob Blame History Raw
diff -rupN --no-dereference poppler-21.08.0/poppler/JPXStream.cc poppler-21.08.0-new/poppler/JPXStream.cc
--- poppler-21.08.0/poppler/JPXStream.cc	2021-08-01 17:19:17.000000000 +0200
+++ poppler-21.08.0-new/poppler/JPXStream.cc	2022-09-13 14:26:47.308613177 +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");