Skip to content

Commit

Permalink
DO NOT MERGE) ExifInterface: Close the file when an exception happens
Browse files Browse the repository at this point in the history
Bug: 32068647, Bug: 30936376
Change-Id: I22fa2384348c890ca726d2b1632cd54e59d25a8f
  • Loading branch information
Sungsoo committed Oct 18, 2016
1 parent 6739ba0 commit 418e086
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion media/java/android/media/ExifInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -1330,8 +1330,9 @@ private void loadAttributes() throws IOException {
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) {
Expand All @@ -1344,6 +1345,7 @@ private void loadAttributes() throws IOException {
if (DEBUG) {
printAttributes();
}
IoUtils.closeQuietly(in);
}
}

Expand Down

0 comments on commit 418e086

Please sign in to comment.