[xiph-commits] r11307 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Fri Apr 28 17:43:02 PDT 2006


Author: jm
Date: 2006-04-28 17:42:58 -0700 (Fri, 28 Apr 2006)
New Revision: 11307

Modified:
   trunk/speex/libspeex/jitter.c
Log:
Patch for two memory leaks and a read overflow in the jitter buffer by 
Dirk Schramm.


Modified: trunk/speex/libspeex/jitter.c
===================================================================
--- trunk/speex/libspeex/jitter.c	2006-04-28 14:04:22 UTC (rev 11306)
+++ trunk/speex/libspeex/jitter.c	2006-04-29 00:42:58 UTC (rev 11307)
@@ -120,6 +120,7 @@
 /** Destroy jitter buffer */
 void jitter_buffer_destroy(JitterBuffer *jitter)
 {
+   jitter_buffer_reset(jitter);
    speex_free(jitter);
 }
 
@@ -169,6 +170,7 @@
             i=j;
          }
       }
+      speex_free(jitter->buf[i]);
       if (jitter->lost_count>20)
       {
          jitter_buffer_reset(jitter);
@@ -454,7 +456,6 @@
    int i;
    int ret;
    char data[2048];
-   int length = 2048;
    JitterBufferPacket packet;
    packet.data = data;
    
@@ -481,7 +482,7 @@
       /*Packet is late or lost*/
       speex_decode_int(jitter->dec, NULL, out);
    } else {
-      speex_bits_read_from(&jitter->current_packet, packet.data, length);
+      speex_bits_read_from(&jitter->current_packet, packet.data, packet.len);
       /* Decode packet */
       ret = speex_decode_int(jitter->dec, &jitter->current_packet, out);
       if (ret == 0)



More information about the commits mailing list