diff --git a/app/src/main/java/sushi/hardcore/droidfs/file_viewers/EncryptedVolumeDataSource.kt b/app/src/main/java/sushi/hardcore/droidfs/file_viewers/EncryptedVolumeDataSource.kt index 859694a..f4e59ca 100644 --- a/app/src/main/java/sushi/hardcore/droidfs/file_viewers/EncryptedVolumeDataSource.kt +++ b/app/src/main/java/sushi/hardcore/droidfs/file_viewers/EncryptedVolumeDataSource.kt @@ -50,7 +50,11 @@ class EncryptedVolumeDataSource(private val encryptedVolume: EncryptedVolume, pr ) {} val totalRead = fileOffset-originalOffset bytesRemaining -= totalRead - return totalRead.toInt() + return if (totalRead == 0L) { + C.RESULT_END_OF_INPUT + } else { + totalRead.toInt() + } } class Factory(private val encryptedVolume: EncryptedVolume, private val filePath: String): DataSource.Factory {