[xiph-commits] r13178 - trunk/speex/src

jm at svn.xiph.org jm at svn.xiph.org
Fri Jun 22 21:24:56 PDT 2007


Author: jm
Date: 2007-06-22 21:24:56 -0700 (Fri, 22 Jun 2007)
New Revision: 13178

Modified:
   trunk/speex/src/speexdec.c
   trunk/speex/src/speexenc.c
Log:
fixed stuff from coverity


Modified: trunk/speex/src/speexdec.c
===================================================================
--- trunk/speex/src/speexdec.c	2007-06-23 04:24:48 UTC (rev 13177)
+++ trunk/speex/src/speexdec.c	2007-06-23 04:24:56 UTC (rev 13178)
@@ -317,6 +317,7 @@
    {
       fprintf (stderr, "Mode number %d does not (yet/any longer) exist in this version\n", 
                header->mode);
+      free(header);
       return NULL;
    }
       
@@ -329,17 +330,20 @@
    if (header->speex_version_id > 1)
    {
       fprintf (stderr, "This file was encoded with Speex bit-stream version %d, which I don't know how to decode\n", header->speex_version_id);
+      free(header);
       return NULL;
    }
 
    if (mode->bitstream_version < header->mode_bitstream_version)
    {
       fprintf (stderr, "The file was encoded with a newer version of Speex. You need to upgrade in order to play it.\n");
+      free(header);
       return NULL;
    }
    if (mode->bitstream_version > header->mode_bitstream_version) 
    {
       fprintf (stderr, "The file was encoded with an older version of Speex. You would need to downgrade the version in order to play it.\n");
+      free(header);
       return NULL;
    }
    
@@ -347,6 +351,7 @@
    if (!st)
    {
       fprintf (stderr, "Decoder initialization failed.\n");
+      free(header);
       return NULL;
    }
    speex_decoder_ctl(st, SPEEX_SET_ENH, &enh_enabled);

Modified: trunk/speex/src/speexenc.c
===================================================================
--- trunk/speex/src/speexenc.c	2007-06-23 04:24:48 UTC (rev 13177)
+++ trunk/speex/src/speexenc.c	2007-06-23 04:24:56 UTC (rev 13178)
@@ -969,7 +969,7 @@
 
   p=(char*)realloc(p, len);
   if(p==NULL){
-     fprintf (stderr, "malloc failed in comment_init()\n");
+     fprintf (stderr, "realloc failed in comment_add()\n");
      exit(1);
   }
 



More information about the commits mailing list