diff --git a/NEWS b/NEWS index 74aeac543..20fd281f9 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.20.6 (not yet released) +* decoder + - mpcdec: fix crash (division by zero) after seeking ver 0.20.5 (2017/02/20) * tags diff --git a/src/decoder/plugins/MpcdecDecoderPlugin.cxx b/src/decoder/plugins/MpcdecDecoderPlugin.cxx index 08a5a3525..0e58c0098 100644 --- a/src/decoder/plugins/MpcdecDecoderPlugin.cxx +++ b/src/decoder/plugins/MpcdecDecoderPlugin.cxx @@ -207,6 +207,15 @@ mpcdec_decode(DecoderClient &client, InputStream &is) if (frame.bits == -1) break; + if (frame.samples <= 0) { + /* empty frame - this has been observed to + happen spuriously after seeking; skip this + obscure frame, and hope libmpcdec + recovers */ + cmd = client.GetCommand(); + continue; + } + mpc_uint32_t ret = frame.samples; ret *= info.channels;