From 23817eecfd77ddac87dbcba2ccb9aef1e459b178 Mon Sep 17 00:00:00 2001 From: eguven Date: Tue, 28 Aug 2018 03:01:02 -0700 Subject: [PATCH] Release zip inflater when finished ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=210513776 --- .../exoplayer2/video/spherical/ProjectionDecoder.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) {