[xiph-commits] r13174 - branches/speex-branches/speex-1.0-branch/src

jm at svn.xiph.org jm at svn.xiph.org
Fri Jun 22 20:57:59 PDT 2007


Author: jm
Date: 2007-06-22 20:57:58 -0700 (Fri, 22 Jun 2007)
New Revision: 13174

Modified:
   branches/speex-branches/speex-1.0-branch/src/speexenc.c
Log:
check for malloc failure


Modified: branches/speex-branches/speex-1.0-branch/src/speexenc.c
===================================================================
--- branches/speex-branches/speex-1.0-branch/src/speexenc.c	2007-06-22 09:12:03 UTC (rev 13173)
+++ branches/speex-branches/speex-1.0-branch/src/speexenc.c	2007-06-23 03:57:58 UTC (rev 13174)
@@ -803,6 +803,8 @@
   int len=4+vendor_length+4;
   char *p=(char*)malloc(len);
   if(p==NULL){
+     fprintf (stderr, "malloc failed in comment_init()\n");
+     exit(1);
   }
   writeint(p, 0, vendor_length);
   memcpy(p+4, vendor_string, vendor_length);
@@ -821,6 +823,8 @@
 
   p=(char*)realloc(p, len);
   if(p==NULL){
+     fprintf (stderr, "realloc failed in comment_add()\n");
+     exit(1);
   }
 
   writeint(p, *length, tag_len+val_len);      /* length of comment */



More information about the commits mailing list