Commit 4adad5a1 authored by Christophe Gisquet's avatar Christophe Gisquet Committed by Paul B Mahol

wavpackenc: reset trailer info on block encoding

In some cases, in particular if several blocks are needed because of
the channel layout (e.g. 2.1), the information used to write the
trailing bits terminating the sample data was not reset.

This would cause potential desync on the decoder, although decoded
samples were actually mostly fine.

Fixes ticket #3879.
parent a59f85d1
...@@ -2487,6 +2487,9 @@ static int wavpack_encode_block(WavPackEncodeContext *s, ...@@ -2487,6 +2487,9 @@ static int wavpack_encode_block(WavPackEncodeContext *s,
struct Decorr *dpp; struct Decorr *dpp;
PutByteContext pb; PutByteContext pb;
if (s->flags & WV_MONO_DATA) {
CLEAR(s->w);
}
if (!(s->flags & WV_MONO) && s->optimize_mono) { if (!(s->flags & WV_MONO) && s->optimize_mono) {
int32_t lor = 0, diff = 0; int32_t lor = 0, diff = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment