[Bug 4200] map_image() can cause segfault