Prevent some IOExceptions when past the end of stream.

fork-5.53.8
Alan Evans 2020-05-11 16:04:42 -03:00 zatwierdzone przez Alex Hart
rodzic a510bc74e6
commit 1778c1ef7d
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -38,6 +38,10 @@ final class ModernEncryptedMediaDataSource extends MediaDataSource {
@Override
public int readAt(long position, byte[] bytes, int offset, int length) throws IOException {
if (position >= this.length) {
return -1;
}
try (InputStream inputStream = createInputStream(position)) {
int totalRead = 0;