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

Raster and SampleModel methods should perform better bounds checking

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.2.0, 1.4.0
    • Fix Version/s: 1.4.0
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • Resolved In Build:
      beta
    • CPU:
      generic
    • OS:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: