Making redundancy length decoding errors non-fatal
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 6 Sep 2011 19:19:04 +0000 (15:19 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 6 Sep 2011 19:19:04 +0000 (15:19 -0400)
src/opus_decoder.c

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