--- old/src/java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c 2018-04-12 15:36:00.383740500 +0100 +++ new/src/java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c 2018-04-12 15:35:59.478328000 +0100 @@ -350,6 +350,10 @@ } cData->img_clr_tbl = initCubemap(pRgb, bisdo->lutsize, 32); + if (cData->img_clr_tbl == NULL) { + free(cData); + return (ColorData*)NULL; + } cData->representsPrimaries = calculatePrimaryColorsApproximation(pRgb, cData->img_clr_tbl, 32); if (allGray == JNI_TRUE) { initInverseGrayLut(pRgb, bisdo->lutsize, cData);