am 98539a4e: Merge "stagefright amrwbenc: Make the mem_malloc function 64-bit safe"

* commit '98539a4eba7677c0b1ddc12f800c7075851ef302':
  stagefright amrwbenc: Make the mem_malloc function 64-bit safe
This commit is contained in:
Jean-Baptiste Queru
2012-01-24 15:13:45 -08:00
committed by Android Git Automerger

View File

@@ -23,6 +23,11 @@
#include "mem_align.h" #include "mem_align.h"
#ifdef _MSC_VER
#include <stddef.h>
#else
#include <stdint.h>
#endif
/***************************************************************************** /*****************************************************************************
* *
@@ -66,8 +71,8 @@ mem_malloc(VO_MEM_OPERATOR *pMemop, unsigned int size, unsigned char alignment,
pMemop->Set(CodecID, tmp, 0, size + alignment); pMemop->Set(CodecID, tmp, 0, size + alignment);
mem_ptr = mem_ptr =
(unsigned char *) ((unsigned int) (tmp + alignment - 1) & (unsigned char *) ((intptr_t) (tmp + alignment - 1) &
(~((unsigned int) (alignment - 1)))); (~((intptr_t) (alignment - 1))));
if (mem_ptr == tmp) if (mem_ptr == tmp)
mem_ptr += alignment; mem_ptr += alignment;