Fix unintended state sharing

This commit is contained in:
Ali 2022-08-04 01:14:10 +04:00
parent 83363104ee
commit f712c2bed7
2 changed files with 8 additions and 4 deletions

View File

@ -118,6 +118,11 @@ void scaleImagePlane(uint8_t *outPlane, int outWidth, int outHeight, int outByte
}
void convertUInt8toInt16(uint8_t const *source, int16_t *dest, int length) {
#if DEBUG
assert(!((intptr_t)source % sizeof(uint64_t)));
assert(!((intptr_t)dest % sizeof(uint64_t)));
#endif
for (int i = 0; i < length; i += 8 * 4) {
#pragma unroll
for (int j = 0; j < 4; j++) {

View File

@ -1436,11 +1436,10 @@ public final class AnimationCacheImpl: AnimationCache {
let _ = generateFirstFrameFromItem(currentQueue: queue, itemPath: itemFirstFramePath, animationItemPath: itemPath, allocateTempFile: allocateTempFile)
guard let item = try? loadItem(path: itemPath) else {
return
}
for f in itemContext.subscribers.copyItems() {
guard let item = try? loadItem(path: itemPath) else {
continue
}
f(AnimationCacheItemResult(item: item, isFinal: true))
}
}