# HG changeset patch # User jdv # Date 1465980764 -19800 # Node ID 2be87ed267addf3664d1d958a981a9d608fd8efe # Parent 0e1925d06a4de0df38dd97bfa35527b8204f1b81 6386906: Faulty rounding code in BMPImageReader.decodeRLE4() Reviewed-by: flar, psadhukhan Contributed-by: jayathirth.d.v@oracle.com diff -r 0e1925d06a4d -r 2be87ed267ad 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;