frameworks/base
修訂 | 596ffb80bb55a91f80a029c947d09f0911c616a3 (tree) |
---|---|
時間 | 2016-12-13 05:00:56 |
作者 | Sungsoo <sungsoo@goog...> |
Commiter | Jessica Wagantall |
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)
@@ -1335,8 +1335,9 @@ public class ExifInterface { | ||
1335 | 1335 | for (int i = 0; i < EXIF_TAGS.length; ++i) { |
1336 | 1336 | mAttributes[i] = new HashMap(); |
1337 | 1337 | } |
1338 | + InputStream in = null; | |
1338 | 1339 | try { |
1339 | - InputStream in = new FileInputStream(mFilename); | |
1340 | + in = new FileInputStream(mFilename); | |
1340 | 1341 | getJpegAttributes(in); |
1341 | 1342 | mIsSupportedFile = true; |
1342 | 1343 | } catch (IOException e) { |
@@ -1349,6 +1350,7 @@ public class ExifInterface { | ||
1349 | 1350 | if (DEBUG) { |
1350 | 1351 | printAttributes(); |
1351 | 1352 | } |
1353 | + IoUtils.closeQuietly(in); | |
1352 | 1354 | } |
1353 | 1355 | } |
1354 | 1356 |