From 71230e8bd129487974840c72698c476903897488 Mon Sep 17 00:00:00 2001 From: smallsql Date: Sat, 26 Jan 2013 11:52:59 +0000 Subject: [PATCH] Monitor must create before usage else it throw a NPE. This fix a NPE with usage of the not standard constructors of BufferedImage. --- openjdk/java/awt/image/BufferedImage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openjdk/java/awt/image/BufferedImage.java b/openjdk/java/awt/image/BufferedImage.java index 6984f504..33c9c270 100644 --- a/openjdk/java/awt/image/BufferedImage.java +++ b/openjdk/java/awt/image/BufferedImage.java @@ -687,8 +687,8 @@ public class BufferedImage extends java.awt.Image { throw new IllegalArgumentException(); } + bitmap = createBitmap(width, height); synchronized( bitmap ) { - bitmap = createBitmap(width, height); cli.System.Drawing.Rectangle rect = new cli.System.Drawing.Rectangle(0, 0, width, height); cli.System.Drawing.Imaging.BitmapData data = bitmap.LockBits(rect, ImageLockMode.wrap(ImageLockMode.WriteOnly), PixelFormat.wrap(PixelFormat.Format32bppArgb)); cli.System.IntPtr pixelPtr = data.get_Scan0();