shithub: opus-tools

Download patch

ref: 315f60d9787483c3619eaab9d03510d72eea2417
parent: dc500a7ac53098c5b360c33936a2e74c6a99cbfc
author: Gregory Maxwell <greg@xiph.org>
date: Sun May 27 13:49:30 EDT 2012

End padding buffer is per channel.

--- a/src/opusdec.c
+++ b/src/opusdec.c
@@ -795,10 +795,10 @@
          /* Drain the resampler */
          if(eos && resampler)
          {
-            float zeros[100];
+            float *zeros;
             int drain;
 
-            for (i=0;i<100;i++)zeros[i] = 0;
+            zeros=(float *)calloc(100*channels,sizeof(float));
             drain = speex_resampler_get_input_latency(resampler);
             do {
                opus_int64 outsamp;
@@ -810,6 +810,7 @@
                audio_size+=sizeof(short)*outsamp*channels;
                drain -= tmp;
             } while (drain>0);
+            free(zeros);
             speex_resampler_destroy(resampler);
             resampler=NULL;
          }