Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd1cdb46 authored by Narayan Kamath's avatar Narayan Kamath Committed by Android Git Automerger
Browse files

am 9d01914a: am fdb70dc4: Merge "Fix filedescriptor leakage in MediaMetadataRetriever"

* commit '9d01914a':
  Fix filedescriptor leakage in MediaMetadataRetriever
parents c279a835 9d01914a
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -64,9 +64,7 @@ public class MediaMetadataRetriever
            throw new IllegalArgumentException();
        }

        FileInputStream is = null;
        try {
            is = new FileInputStream(path);
        try (FileInputStream is = new FileInputStream(path)) {
            FileDescriptor fd = is.getFD();
            setDataSource(fd, 0, 0x7ffffffffffffffL);
        } catch (FileNotFoundException fileEx) {
@@ -74,12 +72,6 @@ public class MediaMetadataRetriever
        } catch (IOException ioEx) {
            throw new IllegalArgumentException();
        }

        try {
            if (is != null) {
                is.close();
            }
        } catch (Exception e) {}
    }

    /**