6386906: Faulty rounding code in BMPImageReader.decodeRLE4()
authorjdv
Wed, 15 Jun 2016 14:22:44 +0530
changeset 39517 2be87ed267ad
parent 39516 0e1925d06a4d
child 39518 cf5567d544b4
6386906: Faulty rounding code in BMPImageReader.decodeRLE4() Reviewed-by: flar, psadhukhan Contributed-by: jayathirth.d.v@oracle.com
jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java	Wed Jun 15 12:04:29 2016 +0530
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java	Wed Jun 15 14:22:44 2016 +0530
@@ -1655,7 +1655,7 @@
 
                     // 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 ) {
+                    if ((((end + 1) / 2) & 1) == 1) {
                         count++;
                     }
                     break;