Skip to content
Snippets Groups Projects
Commit 2b98bdf5 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Better handling of DTX for range coder state checks

parent d4827737
No related branches found
No related tags found
No related merge requests found
......@@ -442,7 +442,10 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
st->channels, window, st->Fs);
}
st->rangeFinal = dec.rng ^ redundant_rng;
if (len <= 1)
st->rangeFinal = 0;
else
st->rangeFinal = dec.rng ^ redundant_rng;
st->prev_mode = mode;
st->prev_redundancy = redundancy;
......
......@@ -261,6 +261,7 @@ int opus_encode_float(OpusEncoder *st, const opus_val16 *pcm, int frame_size,
opus_uint32 redundant_rng = 0;
ALLOC_STACK;
st->rangeFinal = 0;
if (400*frame_size != st->Fs && 200*frame_size != st->Fs && 100*frame_size != st->Fs &&
50*frame_size != st->Fs && 25*frame_size != st->Fs && 50*frame_size != 3*st->Fs)
return OPUS_BAD_ARG;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment