Miniseed file crashes obspy

Hi all,

the miniseed file available under the following link crashes obspy with a segmentation fault, as soon as you try to write it with STEIM2 encoding:

As you can see when you plot the data, there is a huge spike with a difference larger than 2**30 in the signal which probably causes the crash.

Hi Roman,

this has been fixed here:

Fixed in the sense that it now returns a nice error message:

  File "/Users/lion/workspace/code/obspy/obspy/core/", line
1442, in write
    write_format(self, filename, **kwargs)
  File "/Users/lion/workspace/code/obspy/obspy/io/mseed/", line
922, in _write_mseed
    C.byref(packedsamples), flush, verbose, msr) # NOQA
  File "/Users/lion/workspace/code/obspy/obspy/io/mseed/",
line 833, in _wrapper
    raise InternalMSEEDError(msg) Encountered 2 error(s) during a call
to mst_pack():
msr_encode_steim2(8X_CA04A__HHE_D): Unable to represent difference in <=
30 bits
msr_pack(8X_CA04A__HHE_D): Error packing data samples

STEIM2 can just not store data with spikes of this magnitude.