6386906: Faulty rounding code in BMPImageReader.decodeRLE4()
Reviewed-by: flar, psadhukhan
Contributed-by: jayathirth.d.v@oracle.com
--- 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;