Making redundancy length decoding errors non-fatal

This commit is contained in:
Jean-Marc Valin 2011-09-06 15:19:04 -04:00
parent 331e9fe0fd
commit 50ef21c0a9

View file

@ -323,9 +323,11 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
} }
} }
len -= redundancy_bytes; len -= redundancy_bytes;
if (len<0) { if (len<0)
RESTORE_STACK; {
return OPUS_INVALID_PACKET; len=0;
redundancy_bytes=0;
redundancy = 0;
} }
/* Shrink decoder because of raw bits */ /* Shrink decoder because of raw bits */
dec.storage -= redundancy_bytes; dec.storage -= redundancy_bytes;