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
parent 5d1bfd9d5f
commit cb17930077

View File

@@ -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);
}
}