Skip to content

Conversation

@yannaingtun
Copy link

Description

This PR fixes a file descriptor leak in the setDataSource(FileDescriptor, long, long) method. The current implementation fails to properly handle the file descriptor, leading to potential resource exhaustion over time.

Fix Details

  • Added proper file descriptor duplication with ParcelFileDescriptor
  • Ensured proper cleanup in a finally block to prevent leaks
  • Avoided unnecessary double-duplication of file descriptors

References

Security Impact

This fix prevents file descriptor leaks which can lead to resource exhaustion and potential app crashes after extended use, especially when processing multiple media files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant