Empty sound data fix

This commit is contained in:
Jindra Petřík
2024-08-28 18:42:31 +02:00
parent 21cb1d5cb9
commit 089f52bb9b

View File

@@ -214,11 +214,13 @@ public class SoundFormat {
byte[] decodedData = baos.toByteArray();
if (skipSamples > 0) {
byte[] data = decodedData;
data = Arrays.copyOfRange(
data,
skipSamples * 2 * (stereo ? 2 : 1),
data.length
);
if (data.length > 0) {
data = Arrays.copyOfRange(
data,
skipSamples * 2 * (stereo ? 2 : 1),
data.length
);
}
return data;
}