system/bt
Revision | 8355edcb78de63e36f236b26bdfc22c3802b5806 (tree) |
---|---|
Zeit | 2020-03-13 05:38:09 |
Autor | Hansong Zhang <hsz@goog...> |
Commiter | Anis Assi |
AAC Decoder: Use osi_free() to free buffers allocated by osi_malloc()
* buffers allocated by osi_malloc() have canary bytes around it and need special method
Bug: 148107188
Test: manual
Change-Id: Ifcfe494737c47e33755297214d3f637852a8be0b
(cherry picked from commit b88f8057fd28ca271ccd436a17f6489d4cf46697)
(cherry picked from commit 7a6fd5459ef8c6a2c21774e1220deb1023ae2935)
@@ -30,7 +30,7 @@ | ||
30 | 30 | typedef struct { |
31 | 31 | HANDLE_AACDECODER aac_handle; |
32 | 32 | bool has_aac_handle; // True if aac_handle is valid |
33 | - INT_PCM* decode_buf; | |
33 | + INT_PCM* decode_buf = nullptr; | |
34 | 34 | decoded_data_callback_t decode_callback; |
35 | 35 | } tA2DP_AAC_DECODER_CB; |
36 | 36 |
@@ -58,7 +58,7 @@ bool a2dp_aac_decoder_init(decoded_data_callback_t decode_callback) { | ||
58 | 58 | void a2dp_aac_decoder_cleanup(void) { |
59 | 59 | if (a2dp_aac_decoder_cb.has_aac_handle) |
60 | 60 | aacDecoder_Close(a2dp_aac_decoder_cb.aac_handle); |
61 | - free(a2dp_aac_decoder_cb.decode_buf); | |
61 | + osi_free(a2dp_aac_decoder_cb.decode_buf); | |
62 | 62 | memset(&a2dp_aac_decoder_cb, 0, sizeof(a2dp_aac_decoder_cb)); |
63 | 63 | } |
64 | 64 |