When loading ccp4 map from MemoryStream, the position of the stream is not advanced, since the Stream is passed by value. This breaks the loader since the header bytes are read again as grid data later.
Passing the Stream f by reference fixes this issue.
https://github.com/project-gemmi/gemmi/blob/f8048836778d1528e0a6c3486ef9a6806288f0e7/include/gemmi/ccp4.hpp#L172
When loading ccp4 map from MemoryStream, the position of the stream is not advanced, since the Stream is passed by value. This breaks the loader since the header bytes are read again as grid data later. Passing the Stream f by reference fixes this issue.