File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
glideplugin/src/main/java/com/opensource/svgaplayer/glideplugin Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import com.opensource.svgaplayer.proto.MovieEntity
8
8
import java.io.ByteArrayOutputStream
9
9
import java.io.File
10
10
import java.io.InputStream
11
+ import java.util.zip.Inflater
11
12
import java.util.zip.InflaterInputStream
12
13
13
14
/* *
@@ -35,8 +36,9 @@ internal class SVGAEntityStreamDecoder(
35
36
36
37
private fun inflate (source : InputStream ): ByteArray? = attempt {
37
38
val buffer = arrayPool.get(ArrayPool .STANDARD_BUFFER_SIZE_BYTES , ByteArray ::class .java)
39
+ val inflater = Inflater ()
38
40
try {
39
- InflaterInputStream (source).let { input ->
41
+ InflaterInputStream (source, inflater ).let { input ->
40
42
ByteArrayOutputStream ().let { output ->
41
43
while (true ) {
42
44
val cnt = input.read(buffer)
@@ -48,6 +50,7 @@ internal class SVGAEntityStreamDecoder(
48
50
}
49
51
} finally {
50
52
arrayPool.put(buffer)
53
+ inflater.end()
51
54
}
52
55
}
53
56
}
You can’t perform that action at this time.
0 commit comments