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

Faulty rounding code in BMPImageReader.decodeRLE4()

    XMLWordPrintable

Details

    • 5.0
    • b127
    • x86
    • windows_xp

    Description

      FULL PRODUCT VERSION :
      mustang early release

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
       In com.sun.imageio.plugins.bmp.BMPImageReader.decodeRLE is this rounding code

                        // Whenever end pixels can fit into odd number of bytes,
                          // an extra padding byte will be present, so skip that.
                          if ((((int)Math.ceil(end/2)) & 1) ==1 ) {
                              count++;

      notice that end/2 is an int so ceil doesn't make any sense.

      Perhaps you want end/2.0


      REPRODUCIBILITY :
      This bug can be reproduced always.

      Attachments

        Activity

          People

            jdv Jayathirth D V
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: