changeset 39517:2be87ed267ad

6386906: Faulty rounding code in BMPImageReader.decodeRLE4() Reviewed-by: flar, psadhukhan Contributed-by: jayathirth.d.v@oracle.com
author jdv
date Wed, 15 Jun 2016 14:22:44 +0530
parents 0e1925d06a4d
children cf5567d544b4
files jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;