[xiph-cvs] cvs commit: theora/win32 theora_static.dsp
Mauricio Piacentini
mauricio at xiph.org
Mon May 12 15:23:03 PDT 2003
mauricio 03/05/12 18:23:03
Modified: lib comment.c toplevel.c
win32 theora_static.dsp
Log:
fixes memory leak in toplevel.c
Revision Changes Path
1.3 +5 -4 theora/lib/comment.c
Index: comment.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/comment.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- comment.c 12 May 2003 00:29:46 -0000 1.2
+++ comment.c 12 May 2003 22:23:03 -0000 1.3
@@ -11,7 +11,7 @@
********************************************************************
function: read/write and client interface for comment header packet
- last mod: $Id: comment.c,v 1.2 2003/05/12 00:29:46 giles Exp $
+ last mod: $Id: comment.c,v 1.3 2003/05/12 22:23:03 mauricio Exp $
********************************************************************/
@@ -37,11 +37,12 @@
}
void theora_comment_add_tag(theora_comment *tc, char *tag, char *value){
- char *comment=alloca(strlen(tag)+strlen(value)+2); /* +2 for = and \0 */
+ char *comment=_ogg_malloc(strlen(tag)+strlen(value)+2); /* +2 for = and \0 */
strcpy(comment, tag);
strcat(comment, "=");
strcat(comment, value);
theora_comment_add(tc, comment);
+ _ogg_free(comment);
}
/* This is more or less the same as strncasecmp - but that doesn't exist
@@ -80,7 +81,7 @@
int theora_comment_query_count(theora_comment *tc, char *tag){
int i,count=0;
int taglen = strlen(tag)+1; /* +1 for the = we append */
- char *fulltag = alloca(taglen+1);
+ char *fulltag = _ogg_malloc(taglen+1);
strcpy(fulltag,tag);
strcat(fulltag, "=");
@@ -88,7 +89,7 @@
if(!tagcompare(tc->user_comments[i], fulltag, taglen))
count++;
}
-
+ _ogg_free(fulltag);
return count;
}
<p><p>1.18 +5 -1 theora/lib/toplevel.c
Index: toplevel.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/toplevel.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- toplevel.c 12 May 2003 00:29:46 -0000 1.17
+++ toplevel.c 12 May 2003 22:23:03 -0000 1.18
@@ -11,7 +11,7 @@
********************************************************************
function:
- last mod: $Id: toplevel.c,v 1.17 2003/05/12 00:29:46 giles Exp $
+ last mod: $Id: toplevel.c,v 1.18 2003/05/12 22:23:03 mauricio Exp $
********************************************************************/
@@ -1145,15 +1145,19 @@
EClearFrameInfo(cpi);
ClearTmpBuffers(&cpi->pb);
ClearPPInstance(&cpi->pp);
+
+ _ogg_free(t->internal_encode);
}
if(pbi){
+ ClearHuffmanSet(pbi);
ClearFragmentInfo(pbi);
ClearFrameInfo(pbi);
ClearPBInstance(pbi);
+ _ogg_free(t->internal_decode);
}
t->internal_encode=NULL;
<p><p>1.2 +4 -0 theora/win32/theora_static.dsp
Index: theora_static.dsp
===================================================================
RCS file: /usr/local/cvsroot/theora/win32/theora_static.dsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- theora_static.dsp 8 May 2003 21:53:46 -0000 1.1
+++ theora_static.dsp 12 May 2003 22:23:03 -0000 1.2
@@ -89,6 +89,10 @@
# End Source File
# Begin Source File
+SOURCE=..\lib\comment.c
+# End Source File
+# Begin Source File
+
SOURCE=..\lib\dct.c
# End Source File
# Begin Source File
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list