Skip to content

Commit 98539a4

Browse files
Jean-Baptiste Queruandroid code review
authored andcommitted
Merge "stagefright amrwbenc: Make the mem_malloc function 64-bit safe"
2 parents d80cbb8 + 656bb97 commit 98539a4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

media/libstagefright/codecs/amrwbenc/src/mem_align.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323

2424

2525
#include "mem_align.h"
26+
#ifdef _MSC_VER
27+
#include <stddef.h>
28+
#else
29+
#include <stdint.h>
30+
#endif
2631

2732
/*****************************************************************************
2833
*
@@ -66,8 +71,8 @@ mem_malloc(VO_MEM_OPERATOR *pMemop, unsigned int size, unsigned char alignment,
6671
pMemop->Set(CodecID, tmp, 0, size + alignment);
6772

6873
mem_ptr =
69-
(unsigned char *) ((unsigned int) (tmp + alignment - 1) &
70-
(~((unsigned int) (alignment - 1))));
74+
(unsigned char *) ((intptr_t) (tmp + alignment - 1) &
75+
(~((intptr_t) (alignment - 1))));
7176

7277
if (mem_ptr == tmp)
7378
mem_ptr += alignment;

0 commit comments

Comments
 (0)