avutil/mem: avoid using intptr_t to access void* in av_dynarray_add()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-03-22 21:14:57 +01:00
parent b0dcf76530
commit 9ba1190297
1 changed files with 3 additions and 3 deletions

View File

@ -280,11 +280,11 @@ void *av_memdup(const void *p, size_t size)
void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem)
{
intptr_t *tab = *(intptr_t**)tab_ptr;
void **tab = *(void ***)tab_ptr;
AV_DYNARRAY_ADD(INT_MAX, sizeof(*tab), tab, *nb_ptr, {
tab[*nb_ptr] = (intptr_t)elem;
*(intptr_t **)tab_ptr = tab;
tab[*nb_ptr] = elem;
*(void ***)tab_ptr = tab;
}, {
*nb_ptr = 0;
av_freep(tab_ptr);