made readMAFrecord() dynamically allocate im buffer