mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-17 16:32:11 +01:00
Invalidate raczlib cache if re-using its memory
This commit is contained in:
1 parent
cdf49196b1
commit
f4abc0ffe4
1 file changed
+2
@@ -135,6 +135,8 @@ func (r *CodecReader) MakeReaderContext(
|
||||
buffer := []byte(nil)
|
||||
if n := dictSize + 4; int64(cap(r.cachedDictionary)) >= n {
|
||||
buffer = r.cachedDictionary[:n]
|
||||
// Invalidate the cached dictionary, as we are re-using its memory.
|
||||
r.cachedDictionaryCRange = rac.Range{}
|
||||
} else {
|
||||
buffer = make([]byte, n)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user