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

Possible leak of framebufferMemory in XVideoInit #506

Closed
abaire opened this issue Sep 17, 2021 · 2 comments · Fixed by #511
Closed

Possible leak of framebufferMemory in XVideoInit #506

abaire opened this issue Sep 17, 2021 · 2 comments · Fixed by #511

Comments

@abaire
Copy link
Contributor

abaire commented Sep 17, 2021

XVideoInit does a check to see if the previously saved framebuffer is already the size of the requested framebuffer at

if (previousFBSize == screenSize) {
. If it is the same size, it reuses the previously saved framebuffer, but does not deallocate framebufferMemory or pass the newly reassigned _fb pointer to AvSetDisplayMode.

I'm not sure if it's a leak or if it's important that there's a mismatch between the framebuffer used in AvSetDisplayMode and the data persisted via AvSetSavedDataAddress and XVideoGetFB.

@kosmas12
Copy link
Contributor

Good day!

I'm the person that authored the reusage code, so I believe I'm the most qualified person for this.

There indeed seems to be a leak there, nothing weird going on with framebuffers.

As for passing _fb, I don't get what you mean. No matter what happens with the framebuffer, _fb is always passed to AvSetSavedDataAddress. Maybe I understood your question wrong. If I did, then please elaborate.

Thanks!

@abaire
Copy link
Contributor Author

abaire commented Sep 22, 2021

Hi!

The issue I meant wrt _fb is that it is not passed to AvSetDisplayMode if it's reused, so the display framebuffer and the saved framebuffer differ, which seems odd.

I suspect the right approach might be to check the saved framebuffer size before allocating any new memory and before calling AvSetDisplayMode so if it's possible to reuse it the method can bomb out early.

Also ran into #507, though I think reusing the framebuffer would actually fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants