DO NOT MERGE) ExifInterface: Close the file when an exception happens

Bug: 32068647, Bug: 30936376
Change-Id: I22fa2384348c890ca726d2b1632cd54e59d25a8f
This commit is contained in:
Sungsoo
2016-10-18 14:12:00 +09:00
committed by Sungsoo Lim
parent 0eef6b3ff2
commit ad74e88f1d

View File

@@ -1330,8 +1330,9 @@ public class ExifInterface {
for (int i = 0; i < EXIF_TAGS.length; ++i) { for (int i = 0; i < EXIF_TAGS.length; ++i) {
mAttributes[i] = new HashMap(); mAttributes[i] = new HashMap();
} }
InputStream in = null;
try { try {
InputStream in = new FileInputStream(mFilename); in = new FileInputStream(mFilename);
getJpegAttributes(in); getJpegAttributes(in);
mIsSupportedFile = true; mIsSupportedFile = true;
} catch (IOException e) { } catch (IOException e) {
@@ -1344,6 +1345,7 @@ public class ExifInterface {
if (DEBUG) { if (DEBUG) {
printAttributes(); printAttributes();
} }
IoUtils.closeQuietly(in);
} }
} }