From 3a6f592294cc3d1e693d5a68bf7526208cdfbdcb Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 19 Apr 2019 10:43:32 +0200 Subject: [PATCH] Use break on reading error instead of return, this way the streams will be closed properly. --- .../implementations/wud/reader/WUDDiscReaderCompressed.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/de/mas/wiiu/jnus/implementations/wud/reader/WUDDiscReaderCompressed.java b/src/de/mas/wiiu/jnus/implementations/wud/reader/WUDDiscReaderCompressed.java index 86ccae5..f88aee2 100644 --- a/src/de/mas/wiiu/jnus/implementations/wud/reader/WUDDiscReaderCompressed.java +++ b/src/de/mas/wiiu/jnus/implementations/wud/reader/WUDDiscReaderCompressed.java @@ -71,7 +71,9 @@ public class WUDDiscReaderCompressed extends WUDDiscReader { input.seek(offset2); int read = input.read(buffer); - if (read < 0) return; + if (read < 0) { + break; + } try { out.write(Arrays.copyOfRange(buffer, 0, bytesToRead)); } catch (IOException e) {