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

Raster and SampleModel methods should perform better bounds checking

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 1.4.0
    • 1.2.0, 1.4.0
    • client-libs
    • 2d
    • beta
    • generic
    • generic, solaris_7

    Description

        All of the classes in java.awt.image and sun.awt.image that implement
      'SampleModel' and 'Raster' should perform bounds checking in all of their
      pixel accessor methods:

      {get,set}DataElements
      {get,set}Pixel
      {get,set}Pixels
      {get,set}Sample
      {get,set}Samples
      {get,put}{Byte,Short}Data

      Currently, they document that an ArrayOutOfBoundsException 'may' be thrown.
      However, in practice the (x, y) coordinates are used to construct an
      array index, which may lie within the relevant array even though the
      coordinate does not lie within the image bounds.

        The band index 'b' is usually used to index a band offsets array in such
      a way that a proper exception is guaranteed to be thrown, so explicit bounds
      checking is not required.

      Attachments

        Issue Links

          Activity

            People

              dricesunw Daniel Rice (Inactive)
              dricesunw Daniel Rice (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: