Skip to content

Commit

Permalink
Make the mem_align routines 64-bit safe
Browse files Browse the repository at this point in the history
  • Loading branch information
mstorsjo committed Mar 17, 2011
1 parent 53ad2ee commit cea9147
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions amrwbenc/src/mem_align.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@


#include "mem_align.h"
#include <stdint.h>

/*****************************************************************************
*
Expand Down Expand Up @@ -66,8 +67,8 @@ mem_malloc(VO_MEM_OPERATOR *pMemop, unsigned int size, unsigned char alignment,
pMemop->Set(CodecID, tmp, 0, size + alignment);

mem_ptr =
(unsigned char *) ((unsigned int) (tmp + alignment - 1) &
(~((unsigned int) (alignment - 1))));
(unsigned char *) ((intptr_t) (tmp + alignment - 1) &
(~((intptr_t) (alignment - 1))));

if (mem_ptr == tmp)
mem_ptr += alignment;
Expand Down

0 comments on commit cea9147

Please sign in to comment.