Fix previous commit by still capping what the encoder will produce
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Sun, 6 Feb 2011 22:32:30 +0000 (17:32 -0500)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Sun, 6 Feb 2011 22:32:30 +0000 (17:32 -0500)
libcelt/celt.c

index 26667e4..6fefd01 100644 (file)
@@ -924,6 +924,8 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
    if (nbCompressedBytes<2 || pcm==NULL)
      return CELT_BAD_ARG;
 
+   /* Can't produce more than 1275 output bytes */
+   nbCompressedBytes = IMIN(nbCompressedBytes,1275);
    frame_size *= st->upsample;
    for (LM=0;LM<=st->mode->maxLM;LM++)
       if (st->mode->shortMdctSize<<LM==frame_size)