Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double free and memory leaks #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mon
Copy link

@mon mon commented Feb 19, 2016

Fixes #9.

ogg_sync_destroy frees ogg->state, which is then freed again by free(ogg). By allocating this separately and letting libogg free it this is avoided.

ogg_stream_init allocates 3 buffers, which are not properly freed. By separately allocating ogg->stream and calling ogg_stream_destroy, these are properly freed. Saves ~26kb of lost memory.

Finally, libogg recommends ogg_sync_pageout be called before ogg_sync_buffer to initialise some buffers. Added a call to it inside AVOggInit to follow this recommendation.

@Kukunin
Copy link

Kukunin commented Oct 15, 2018

👍

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.

2 participants