From 2e7feb51249b620d9b441fdb88699cfc7560f7e8 Mon Sep 17 00:00:00 2001
From: Gregory Maxwell <greg@xiph.org>
Date: Sun, 4 Sep 2011 09:14:55 -0400
Subject: [PATCH] Make opus_decode() reject crazy decode_fec values.

---
 src/opus_decoder.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/opus_decoder.c b/src/opus_decoder.c
index 8d2d6a357..efad173a5 100644
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -633,6 +633,7 @@ int opus_decode_native(OpusDecoder *st, const unsigned char *data,
 	int tot_offset;
 	/* 48 x 2.5 ms = 120 ms */
 	short size[48];
+	if (decode_fec<0 || decode_fec>1)return OPUS_BAD_ARG;
 	if (len==0 || data==NULL)
 	    return opus_decode_frame(st, NULL, 0, pcm, frame_size, 0);
 	else if (len<0)
-- 
GitLab