summaryrefslogtreecommitdiffstats
path: root/fuzzer
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2019-09-09 16:14:50 -0700
committerHarish Mahendrakar <harish.mahendrakar@ittiam.com>2019-09-12 16:37:45 -0700
commit9aefe927788f5eafb457d8f0e373d3e9baa55697 (patch)
tree13ef0295d57a1703aec6d3b9e48fe903b31dde98 /fuzzer
parent724246bc74e3876388f15fbaa5afb5f06badc283 (diff)
downloadplatform_external_libavc-9aefe927788f5eafb457d8f0e373d3e9baa55697.tar.gz
platform_external_libavc-9aefe927788f5eafb457d8f0e373d3e9baa55697.tar.bz2
platform_external_libavc-9aefe927788f5eafb457d8f0e373d3e9baa55697.zip
Replace memalign with posix_memalign
Bug: 140696633 Test: Build and test binaries Change-Id: I2a00a34347732eb91f2dc3514c4fa8fa5b5c51b5
Diffstat (limited to 'fuzzer')
-rw-r--r--fuzzer/avc_dec_fuzzer.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/fuzzer/avc_dec_fuzzer.cpp b/fuzzer/avc_dec_fuzzer.cpp
index 3b00175..35dbca8 100644
--- a/fuzzer/avc_dec_fuzzer.cpp
+++ b/fuzzer/avc_dec_fuzzer.cpp
@@ -18,7 +18,6 @@
* Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
*/
-#include <malloc.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
@@ -49,8 +48,12 @@ enum {
const static int kSupportedColorFormats = NELEMENTS(supportedColorFormats);
const static int kMaxCores = 4;
void *iv_aligned_malloc(void *ctxt, WORD32 alignment, WORD32 size) {
+ void *buf = NULL;
(void)ctxt;
- return memalign(alignment, size);
+ if (0 != posix_memalign(&buf, alignment, size)) {
+ return NULL;
+ }
+ return buf;
}
void iv_aligned_free(void *ctxt, void *buf) {
@@ -217,7 +220,7 @@ void Codec::allocFrame() {
mOutBufHandle.u4_num_bufs = num_bufs;
for (int i = 0; i < num_bufs; i++) {
mOutBufHandle.u4_min_out_buf_size[i] = sizes[i];
- mOutBufHandle.pu1_bufs[i] = (UWORD8 *)memalign(16, sizes[i]);
+ mOutBufHandle.pu1_bufs[i] = (UWORD8 *)iv_aligned_malloc(NULL, 16, sizes[i]);
}
}
void Codec::decodeHeader(const uint8_t *data, size_t size) {