forked from OMAP4-AOSP/android_frameworks_av
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better manage buffer for libstagefright_soft_mpeg4enc
Existing code allocated buffer, adjusted pointer to use it, and would adjust the pointer back when it came time to free the space. The problem was that the adjustment was based on user-supplied values and if the user changed those values between alloc and free (which was possible), the code ended up free()ing the wrong address. We fix this by keeping an extra pointer -- the unmodified allocation -- which we use for the subsequent free() calls. This makes the free() independent of any changes to values that the user provides. Bug: 36075363 Test: ran poc against patched nyc-mr2-dev tree Change-Id: I7013ff5883a945c4647517b2980c76a6558f23d2 (cherry picked from commit 90d2dd4)
- Loading branch information
Showing
2 changed files
with
13 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters