diff --git a/library/core/src/main/java/com/google/android/exoplayer2/video/spherical/ProjectionDecoder.java b/library/core/src/main/java/com/google/android/exoplayer2/video/spherical/ProjectionDecoder.java index 4ef87bddfb..7a3c4998b3 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/video/spherical/ProjectionDecoder.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/video/spherical/ProjectionDecoder.java @@ -121,8 +121,13 @@ public final class ProjectionDecoder { int encoding = input.readInt(); if (encoding == TYPE_DFL8) { ParsableByteArray output = new ParsableByteArray(); - if (!Util.inflate(input, output, new Inflater(true))) { - return null; + Inflater inflater = new Inflater(true); + try { + if (!Util.inflate(input, output, inflater)) { + return null; + } + } finally { + inflater.end(); } input = output; } else if (encoding != TYPE_RAW) {