Showing results for 
Search instead for 
Did you mean: 

EXCEPTION_ACCESS_VIOLATION (0xc0000005) from function "ToIntArray" while using CreateColorImageMappedToDepth


I am using R200 camera and java is the programming language.

I am getting both color and depth image data and able to save that data and also able to recreate the image,But while i am trying to get the mapped color image to depth i am getting ERROR .

i am using CreateColorImageMappedToDepth and getting ERROR while trying to get the integer array via using mappedData.ToIntArray(0, mBuff);

Same code was working F200


    PXCMCapture.Sample sample = senseMgr.QuerySample();
                    if ((sample.color != null)&(sample.depth != null))
                           PXCMImage depth= sample.depth;
                        PXCMImage color= sample.color;
                        PXCMProjection projection=device.CreateProjection();// Create the PXCMProjection instance.             
                        PXCMImage mappedColorImage=projection.CreateColorImageMappedToDepth(depth,color); 
                        PXCMImage.ImageData mappedData = new PXCMImage.ImageData(); 
                        sts = mappedColorImage.AcquireAccess(PXCMImage.Access.ACCESS_READ,PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32, mappedData);
                          if (sts.compareTo(pxcmStatus.PXCM_STATUS_NO_ERROR) < 0)
                           System.out.println ("Failed to mapped  color data with depth");
                          int mBuff[] = new int [mappedData.pitches[0]/4 * cHeight];
                          mappedData.ToIntArray(0, mBuff); //ERROR on this line   
                          m_df.image.setRGB(0, 0, cWidth, cHeight, mBuff, 0, mappedData.pitches[0]/4);



# A fatal error has been detected by the Java Runtime Environment:
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000052f0c220, pid=6160, tid=1384
# JRE version: Java(TM) SE Runtime Environment (8.0_66-b17) (build 1.8.0_66-b17)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.66-b17 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [msvcr100.dll+0x3c220]
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
# An error report file with more information is saved as:
# D:\Software\eclipse-jee-juno-SR2-win32-x86_64\Workspace\IntelR200\hs_err_pid6160.log
# If you would like to submit a bug report, please visit:




0 Kudos
1 Reply
Valued Contributor II

I'm using C# so it may be different to the Java implementation but I do it this way (working with both F200 & R200):

var mwidth =;
var mheight =;
mappedPixels = mdata.ToShortArray(0, mwidth * mheight);

Maybe your mBuff variable is wrong?

0 Kudos