JDK-4886506 : VM crashes when using RescaleOp with certain buffered image types
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.2.2,1.4.2,5.0,5.0u6,6,6u10
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS:
    generic,linux,solaris_2.5.1,solaris_10,windows_xp generic,linux,solaris_2.5.1,solaris_10,windows_xp
  • CPU: generic,x86,sparc
  • Submitted: 2003-07-04
  • Updated: 2013-11-05
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b10Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
I am creating a buffered image of one of the following types and rendering a jpeg image to it's graphics context.
TYPE_3BYTE_BGR
TYPE_4BYTE_ABGR
TYPE_4BYTE_ABGR_PRE
I am creating a RescaleOp instance with a scale factor and an offset that are dynamically specified by the user and filtering the above buffered image using RescaleOp.filter() method. I am rendering back the output buffered image to a frame. When the buffered image is one of the above types, VM crashes at the time of filtering the source image when the scale factor and offset exceeds certain value. 
This is reproducible on Solaris as well as Windows right from JDK1.4+. I noticed this VM crash on JDK1.3 also for TYPE_3BYTE_BGR buffered image type, though i am not able to reproduce this on 1.3 consistantly.

I have attached a sample code. Execute the sample code. Choose the buffered image type you would like to test. The unconverted buffered image will be rendered on the screen. Move the scroll bar to choose values for Scale Factor and offset and check whether the image rendered is getting changed accordingly. Choose the above mentioned buffered image types and choose the values by moving the scroll bar. You will get the VM crash. Scale Factor and Offset values are printed in the console.

I have also attached the image used by this application alongwith the VM crash log file.

=============================================================================
This is reproducible right from JDK1.2.2. On JDK1.3, I am able to reproduce this for TYPE_3BYTE_BGR. (Solaris as well as win32)

###@###.### 2003-07-04
============================================================================

Comments
EVALUATION For buffered images with TYPE_BYTE and TYPE_USHORT data type, the raster lookup operation (implemented by the medialib) is used to perform the rescale operation. Note that given test case use same rescale settings for all components of handled buffered image, that causes the lookup operation with lookup table with single lookup array (one for all raster bands). Note that medialib lookup routine expects to get reference to lookup array for each bands of raster. However, the medialib glue code for raster lookup operation does not initialize correctly the lookup array pointers if provided lookup table contains single lookup array. Usage of uninitialized lookup array pointers leads to observed crash.
10-12-2006