Skip to content

[Media Common] Fix alloc-dealloc mismatch in VAImageBufferType destru…#1995

Open
XinfengZhang wants to merge 1 commit intointel:masterfrom
XinfengZhang:fix1989
Open

[Media Common] Fix alloc-dealloc mismatch in VAImageBufferType destru…#1995
XinfengZhang wants to merge 1 commit intointel:masterfrom
XinfengZhang:fix1989

Conversation

@XinfengZhang
Copy link
Copy Markdown
Contributor

…ction

buf->pData is allocated with MOS_AllocAndZeroMemory (malloc) in MediaLibvaUtilNext::CreateBuffer for Media_Format_CPU buffers, but freed with MOS_DeleteArray (operator delete[]) in DestroyBuffer. This is undefined behavior and flagged by AddressSanitizer as alloc-dealloc-mismatch. Use MOS_FreeMemory (free) to match.

Fixes #1985

…ction

buf->pData is allocated with MOS_AllocAndZeroMemory (malloc) in
MediaLibvaUtilNext::CreateBuffer for Media_Format_CPU buffers, but
freed with MOS_DeleteArray (operator delete[]) in DestroyBuffer.
This is undefined behavior and flagged by AddressSanitizer as
alloc-dealloc-mismatch. Use MOS_FreeMemory (free) to match.

Fixes intel#1985

Signed-off-by: Carl.Zhang <carl.zhang@intel.com>
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.

[Bug]: Intel iHD driver alloc-dealloc-mismatch

1 participant