summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorSungsoo <sungsoo@google.com>2016-10-18 14:12:00 +0900
committerJessica Wagantall <jwagantall@cyngn.com>2016-12-12 12:00:56 -0800
commit596ffb80bb55a91f80a029c947d09f0911c616a3 (patch)
tree540fda4adb42a8c671e6bfde875388a72fd7842e /media
parent54bd7b85b2e3c8c43e9d710d4b592921c96c3846 (diff)
downloadframeworks_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.java4
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);
}
}