[Android] Fix thumbnail generation crash
Nicolas Pomepuy
git at videolan.org
Fri Apr 26 14:56:46 CEST 2019
vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Fri Apr 19 11:35:25 2019 +0200| [10f9cb471ca30a3b119c74751eab8c79c71b228f] | committer: Geoffrey Métais
Fix thumbnail generation crash
> https://code.videolan.org/videolan/vlc-android/commit/10f9cb471ca30a3b119c74751eab8c79c71b228f
---
vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt b/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt
index 39950f7b1..ff582d860 100644
--- a/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt
+++ b/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt
@@ -207,10 +207,8 @@ object ThumbnailsProvider {
}
}
if (count == 0) return null
- val sources = Array(sourcesImages.size) {
- sourcesImages[it]!!
- }
- return if (count == 1) sourcesImages[0] else composeCanvas(sources, count, minWidth, minHeight)
+
+ return if (count == 1) sourcesImages[0] else composeCanvas(sourcesImages.filterNotNull().toTypedArray(), count, minWidth, minHeight)
}
private fun composeCanvas(sourcesImages: Array<Bitmap>, count: Int, minWidth: Int, minHeight: Int): Bitmap {
More information about the Android
mailing list