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

TIFFTag.TIFF_RATIONAL, TIFFTag.TIFF_SRATIONAL - add zero denominator checks?

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 9
    • Fix Version/s: tbd
    • Component/s: client-libs
    • Labels:

      Description

      not sure if should be considered as an issue, but may cause some confusion (b142):

      long r[][] = {{1, 0}};
        int type = TIFFTag.TIFF_RATIONAL;
        TIFFField f = new TIFFField(new TIFFTag("tag", 666, 1 << type), type, r.length, r);

        System.out.println(f.getValueAsString(0));
        System.out.println(f.getAsLong(0));
        System.out.println(f.getAsInt(0));

      => output:

        1/0
        9223372036854775807 //confusing!
        2147483647 // confusing!

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated: