diff options
author | Sungsoo <sungsoo@google.com> | 2016-10-18 14:12:00 +0900 |
---|---|---|
committer | Jessica Wagantall <jwagantall@cyngn.com> | 2016-12-12 12:00:56 -0800 |
commit | 596ffb80bb55a91f80a029c947d09f0911c616a3 (patch) | |
tree | 540fda4adb42a8c671e6bfde875388a72fd7842e /media | |
parent | 54bd7b85b2e3c8c43e9d710d4b592921c96c3846 (diff) | |
download | frameworks_base-596ffb80bb55a91f80a029c947d09f0911c616a3.zip frameworks_base-596ffb80bb55a91f80a029c947d09f0911c616a3.tar.gz frameworks_base-596ffb80bb55a91f80a029c947d09f0911c616a3.tar.bz2 |
DO NOT MERGE) ExifInterface: Close the file when an exception happens
CYNGNOS-3312
Bug: 32068647, Bug: 30936376
Change-Id: I22fa2384348c890ca726d2b1632cd54e59d25a8f
(cherry picked from commit cb17930077de640411407636eebc000e2d06dd9c)
(cherry picked from commit 2c79cada8897dcb171b8227b4ea91c292400702f)
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/ExifInterface.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/media/java/android/media/ExifInterface.java b/media/java/android/media/ExifInterface.java index a2ccdc8..bb75547 100644 --- a/media/java/android/media/ExifInterface.java +++ b/media/java/android/media/ExifInterface.java @@ -1335,8 +1335,9 @@ public class ExifInterface { for (int i = 0; i < EXIF_TAGS.length; ++i) { mAttributes[i] = new HashMap(); } + InputStream in = null; try { - InputStream in = new FileInputStream(mFilename); + in = new FileInputStream(mFilename); getJpegAttributes(in); mIsSupportedFile = true; } catch (IOException e) { @@ -1349,6 +1350,7 @@ public class ExifInterface { if (DEBUG) { printAttributes(); } + IoUtils.closeQuietly(in); } } |