DO NOT MERGE) ExifInterface: Close the file when an exception happens
am: ad74e88f1d
Change-Id: Ic8a6e5b579c028a560436cdc6c3ca68a51cbf229
diff --git a/media/java/android/media/ExifInterface.java b/media/java/android/media/ExifInterface.java
index 532368f..72afabf 100644
--- a/media/java/android/media/ExifInterface.java
+++ b/media/java/android/media/ExifInterface.java
@@ -1330,8 +1330,9 @@
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) {
@@ -1344,6 +1345,7 @@
if (DEBUG) {
printAttributes();
}
+ IoUtils.closeQuietly(in);
}
}