comparison common.c @ 1031:19de1445beb2 libavcodec

use av_malloc() functions - added av_strdup and av_realloc()
author bellard
date Thu, 23 Jan 2003 23:03:09 +0000
parents 1f9afd8b9131
children 44a230c11d83
comparison
equal deleted inserted replaced
1030:801f2739264a 1031:19de1445beb2
169 int index; 169 int index;
170 index = vlc->table_size; 170 index = vlc->table_size;
171 vlc->table_size += size; 171 vlc->table_size += size;
172 if (vlc->table_size > vlc->table_allocated) { 172 if (vlc->table_size > vlc->table_allocated) {
173 vlc->table_allocated += (1 << vlc->bits); 173 vlc->table_allocated += (1 << vlc->bits);
174 vlc->table = realloc(vlc->table, 174 vlc->table = av_realloc(vlc->table,
175 sizeof(VLC_TYPE) * 2 * vlc->table_allocated); 175 sizeof(VLC_TYPE) * 2 * vlc->table_allocated);
176 if (!vlc->table) 176 if (!vlc->table)
177 return -1; 177 return -1;
178 } 178 }
179 return index; 179 return index;
180 } 180 }