Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2111

Cast error in Gouraud shadings

    XMLWordPrintableJSON

Details

    Description

      There's a bug in Type4ShadingContext and Type5ShadingContext:

              long maxSrcCoord = (int) Math.pow(2, bitsPerCoordinate) - 1;
              long maxSrcColor = (int) Math.pow(2, bitsPerColorComponent) - 1;
      

      should be

              long maxSrcCoord = (long) (Math.pow(2, bitsPerCoordinate) - 1);
              long maxSrcColor = (long) (Math.pow(2, bitsPerColorComponent) - 1);
      

      The problem is that maxSrcCoord is 7FFFFFFF instead of FFFFFFFF when bitsPerCoordinate is 32.

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            tilman Tilman Hausherr
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: