Fixed segmentation fault caused by freeing a surface pointed at random.