diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java index 572e420b517..4ed5c2249ed 100644 --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java @@ -60,7 +60,7 @@ protected PatchMeshesShadingContext(PDMeshBasedShadingType shading, ColorModel c @Override protected int[][] calcPixelTableArray(Rectangle deviceBounds) throws IOException { - int[][] array = new int[deviceBounds.width][deviceBounds.height]; + int[][] array = new int[deviceBounds.width + 1][deviceBounds.height + 1]; int initialValue = getBackground() != null ? getRgbBackground() : -1; for (int i = 0; i < deviceBounds.width + 1; i++) {