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

Skip to content
Commit 5f85bddd authored by Dhananjay Kumar's avatar Dhananjay Kumar Committed by Gerrit - the friendly Code Review server
Browse files

libstagefright: Fix heap corruption from AudioSource

AudioSource allocates memory for member variable
mTempBuf in its constructor and deallocates during
reset, but mTempBuf can be dereferenced on event
EVENT_NEW_POS even after reset, since AudioRecord
instance can post this event while exiting threadloop
even after stop is called on AudioRecord.
Also reset is called from destructor only if mStarted
is true, which means the memory can miss deallocation
if start is not called before AudioSource instance is
destroyed.
Moving deallocation of mTempBuf to destructor
will solve both the issues.

Change-Id: Ie42f0894e6b3e7c7ea734814ab90d46ee2d7c753
parent 472edc21
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment