DiscIO: Safety check when allocating memory for TMD