Prevent segmentation fault on ID, when handling malformed records.
@@ -3134,6 +3134,8 @@ cdef class VariantRecord(object):
raise ValueError('Error unpacking VariantRecord')
# causes a memory leak https://github.com/pysam-developers/pysam/issues/773
# return bcf_str_cache_get_charptr(r.d.id) if r.d.id != b'.' else None
+ if (r.d.m_id == 0):
+ raise ValueError('Error extracing ID')
return charptr_to_str(r.d.id) if r.d.id != b'.' else None
@id.setter
