Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8169728

Missing sign checks in TIFFField(TIFFTag tag, int type, int count, Object data) for TIFFTag.TIFF_LONG

    XMLWordPrintable

Details

    Description

      quite similar to JDK-8169650.

      Please run the following code:

              int type = TIFFTag.TIFF_LONG;
              TIFFField f = new TIFFField(new TIFFTag("TAG", 123456, 1 << type),
                  type, 1, new long[]{-100L});
              
              System.out.println(f.getAsLong(0));
              System.out.println(f.getValueAsString(0));

      Output (JDK9 b142) - NOK:
          -100
          -100

      but TIFF_LONG is "32-bit (4-byte) unsigned integer" (http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf) (?)

      at the same time TIFFField(TIFFTag tag, int value) constructor will throw an IllegalArgumentException exception (as expected).

      Attachments

        Activity

          People

            bpb Brian Burkhalter
            avstepan Alexander Stepanov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: