Merge "Fix filedescriptor leakage in MediaMetadataRetriever"
This commit is contained in:
@@ -64,9 +64,7 @@ public class MediaMetadataRetriever
|
|||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
|
|
||||||
FileInputStream is = null;
|
try (FileInputStream is = new FileInputStream(path)) {
|
||||||
try {
|
|
||||||
is = new FileInputStream(path);
|
|
||||||
FileDescriptor fd = is.getFD();
|
FileDescriptor fd = is.getFD();
|
||||||
setDataSource(fd, 0, 0x7ffffffffffffffL);
|
setDataSource(fd, 0, 0x7ffffffffffffffL);
|
||||||
} catch (FileNotFoundException fileEx) {
|
} catch (FileNotFoundException fileEx) {
|
||||||
@@ -74,12 +72,6 @@ public class MediaMetadataRetriever
|
|||||||
} catch (IOException ioEx) {
|
} catch (IOException ioEx) {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
if (is != null) {
|
|
||||||
is.close();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user