Skip to content

Commit 5664d59

Browse files
authored
Fix #1917 (RendererException in ScreenshotAppState: Attempting to upload empty buffer) (#1918)
1 parent 6d83c63 commit 5664d59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2021 jMonkeyEngine
2+
* Copyright (c) 2009-2023 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -100,7 +100,7 @@ private static BufferedImage ensureOpaque(BufferedImage original) {
100100

101101
@Override
102102
public void writeImageFile(OutputStream outStream, String format, ByteBuffer imageData, int width, int height) throws IOException {
103-
BufferedImage awtImage = ImageToAwt.convert(new Image(Image.Format.RGBA8, width, height, imageData, ColorSpace.Linear), false, true, 0);
103+
BufferedImage awtImage = ImageToAwt.convert(new Image(Image.Format.RGBA8, width, height, imageData.duplicate(), ColorSpace.Linear), false, true, 0);
104104
awtImage = verticalFlip(awtImage);
105105

106106
ImageWriter writer = ImageIO.getImageWritersByFormatName(format).next();

0 commit comments

Comments
 (0)