From 4d3e105a6c1d144760ddeb3c1951fa838b935747 Mon Sep 17 00:00:00 2001
From: Gregory Maxwell <greg@xiph.org>
Date: Thu, 3 Feb 2011 23:26:38 -0500
Subject: [PATCH] 1275 byte packets is the absolute maximum packet size we're
 going to support. This makes the encoder and decoder refuse to operate
 outside of these boundaries.

---
 libcelt/celt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libcelt/celt.c b/libcelt/celt.c
index f0a25e7f..9d812ed2 100644
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -919,7 +919,7 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
    int silence=0;
    SAVE_STACK;
 
-   if (nbCompressedBytes<2 || pcm==NULL)
+   if (nbCompressedBytes<2 || nbCompressedBytes>1275 || pcm==NULL)
      return CELT_BAD_ARG;
 
    frame_size *= st->upsample;
@@ -2180,7 +2180,7 @@ int celt_decode_with_ec_float(CELTDecoder * restrict st, const unsigned char *da
 
    SAVE_STACK;
 
-   if (pcm==NULL)
+   if (len<0 || len>1275 || pcm==NULL)
       return CELT_BAD_ARG;
 
    frame_size *= st->downsample;
-- 
GitLab