Created attachment 22790 [details] The .ppt file that causes all this mess Hello I'm currently using Apache POI HSLF to convert in application to convert flowchart Powerpoint files (.ppt) into .png image files. It works ok, normally, without arrows usually, but I found a new crash while converting a .ppt file. I have no idea why this is happening. The sentence that throws NullPointerException is: /* Code Start */ FileInputStream is = new FileInputStream("greenpe.ppt"); SlideShow ppt = new SlideShow (is); is.close(); Dimension pgsize = ppt.getPageSize(); Slide[] slide = ppt.getSlides(); for (int i = 0; i < slide.length; i++) { BufferedImage img = new BufferedImage(pgsize.width, pgsize.height, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = img.createGraphics(); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON); graphics.setPaint(Color.white); graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height)); Slide s = slide[i]; try { s.draw(graphics); } catch (NullPointerException e) { e.printStackTrace; } /* Code Finish */ This is the stack trace: StackTrace: java.lang.NullPointerException at org.apache.poi.hslf.model.Picture.getEscherBSERecord(Picture.java:200) at org.apache.poi.hslf.model.Picture.getPictureData(Picture.java:180) at org.apache.poi.hslf.model.Picture.draw(Picture.java:265) at org.apache.poi.hslf.model.ShapeGroup.draw(ShapeGroup.java:280) at org.apache.poi.hslf.model.Slide.draw(Slide.java:431) at ... (...MyComponent.java:381) Any idea? Thanks
Fixed in r710114 One of the shapes has type=Picture but the reference to picture data is invalid. I fixed Picture.draw to skip rendering of such "invalid" pictures. Yegor