added proto->avi conversion tool, fix a segfault