use av_malloc() functions - added av_strdup and av_realloc()