Skip to content

Conversation

@Manbendra
Copy link

Kotlin decoder uses a hashmap of DoubleArray to store computed cosines. Current code used to first put the empty array in hashmap and was later populating the DoubleArray. So if another thread tries to use cache it would just use uninitialised or partially initialised array which results in seeing black path in blurhash bitmap.

Fix

  1. Now modified the code to use ConcurrentHashMap instead of HashMap
  2. I am updating Map only after the DoubleArray is completely initialised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants