Presumably the assertion here should be done before the first line of code in this function that dereferences the pointer?
https://github.com/xiph/flac/blob/1507800de4b70e21be71f38caa0d9079d0bc6e45/src/libFLAC/metadata_iterators.c#L671C2-L671C30
Similarly in FLAC__metadata_simple_iterator_set_block, FLAC__metadata_simple_iterator_insert_block_after, and for the stats pointer in set_file_stats_.