From 50ef21c0a9dc7e56e6ca8c00b50afae2f9fedc99 Mon Sep 17 00:00:00 2001
From: Jean-Marc Valin <jmvalin@jmvalin.ca>
Date: Tue, 6 Sep 2011 15:19:04 -0400
Subject: [PATCH] Making redundancy length decoding errors non-fatal

---
 src/opus_decoder.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/opus_decoder.c b/src/opus_decoder.c
index bd0886b33..bb1612fbf 100644
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -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;
-- 
GitLab