diff options
author | Truls Bengtsson <truls.bengtsson@sonymobile.com> | 2012-07-11 15:50:44 +0200 |
---|---|---|
committer | Henrik Baard <henrik.baard@sonymobile.com> | 2012-07-11 15:51:31 +0200 |
commit | 9d8e55cd2705a6ab43ea4aca6f94feb7bef87938 (patch) | |
tree | 7bcf2086691994b08fab4f62597b60ab26491cb1 /libvideoeditor | |
parent | ffb829430ff20ccd6c13e6ed894f2373b2d93939 (diff) | |
download | frameworks_av-9d8e55cd2705a6ab43ea4aca6f94feb7bef87938.zip frameworks_av-9d8e55cd2705a6ab43ea4aca6f94feb7bef87938.tar.gz frameworks_av-9d8e55cd2705a6ab43ea4aca6f94feb7bef87938.tar.bz2 |
Initialize pool's buffer pointers to null.
If these pointers are not properly initialized to null and
allocation of one of the buffers subsequently fail, the freePool
mechanism might erroneously free uninitialized pointers.
Change-Id: I2101bdb2cc576e5f50b5a1440e6fc0c54dc4e81b
Diffstat (limited to 'libvideoeditor')
-rwxr-xr-x | libvideoeditor/vss/stagefrightshells/src/VideoEditorBuffer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libvideoeditor/vss/stagefrightshells/src/VideoEditorBuffer.c b/libvideoeditor/vss/stagefrightshells/src/VideoEditorBuffer.c index 98919d2..f4cfa7c 100755 --- a/libvideoeditor/vss/stagefrightshells/src/VideoEditorBuffer.c +++ b/libvideoeditor/vss/stagefrightshells/src/VideoEditorBuffer.c @@ -53,6 +53,7 @@ M4OSA_ERR VIDEOEDITOR_BUFFER_allocatePool(VIDEOEDITOR_BUFFER_Pool** ppool, { M4OSA_ERR lerr = M4NO_ERROR; VIDEOEDITOR_BUFFER_Pool* pool; + M4OSA_UInt32 index; ALOGV("VIDEOEDITOR_BUFFER_allocatePool : ppool = 0x%x nbBuffers = %d ", ppool, nbBuffers); @@ -79,6 +80,11 @@ M4OSA_ERR VIDEOEDITOR_BUFFER_allocatePool(VIDEOEDITOR_BUFFER_Pool** ppool, goto VIDEOEDITOR_BUFFER_allocatePool_Cleanup; } + for (index = 0; index < nbBuffers; index++) + { + pool->pNXPBuffer[index].pData = M4OSA_NULL; + } + ALOGV("VIDEOEDITOR_BUFFER_allocatePool : Allocating Pool name buffer"); pool->poolName = M4OSA_NULL; pool->poolName = (M4OSA_Char*)M4OSA_32bitAlignedMalloc( |