diff mpegaudiodec.c @ 1900:5cde80c5d929 libavcodec

static allocation rewrite (old code was plain a broken mess) doesnt call realloc every time doesnt randomly overwrite memory after after 8-16 calls doesnt use ugly macro wraper fewer lines of code
author michael
date Sun, 21 Mar 2004 21:58:14 +0000
parents cc4c1eb18eec
children 141a9539e270
line wrap: on
line diff
--- a/mpegaudiodec.c	Sat Mar 20 16:40:20 2004 +0000
+++ b/mpegaudiodec.c	Sun Mar 21 21:58:14 2004 +0000
@@ -400,11 +400,11 @@
         }
 
 	/* compute n ^ (4/3) and store it in mantissa/exp format */
-	if (!av_mallocz_static(&table_4_3_exp,
-			       TABLE_4_3_SIZE * sizeof(table_4_3_exp[0])))
+	table_4_3_exp= av_mallocz_static(TABLE_4_3_SIZE * sizeof(table_4_3_exp[0]));
+        if(!table_4_3_exp)
 	    return -1;
-	if (!av_mallocz_static(&table_4_3_value,
-			       TABLE_4_3_SIZE * sizeof(table_4_3_value[0])))
+	table_4_3_value= av_mallocz_static(TABLE_4_3_SIZE * sizeof(table_4_3_value[0]));
+        if(!table_4_3_value)
             return -1;
         
         int_pow_init();