[MN-dev] [mndiff]: r186 - trunk/noe/ldpc.c

michael subversion at mplayerhq.hu
Fri Jul 9 20:34:43 CEST 2010


Author: michael
Date: Fri Jul  9 20:34:43 2010
New Revision: 186

Log:
Get rid of VLAs in ldpc.c.

Modified:
   trunk/noe/ldpc.c

Modified: trunk/noe/ldpc.c
==============================================================================
--- trunk/noe/ldpc.c	Fri Jul  9 20:34:42 2010	(r185)
+++ trunk/noe/ldpc.c	Fri Jul  9 20:34:43 2010	(r186)
@@ -45,7 +45,7 @@ typedef uint8_t ELEM;
 
 static int inverse(ELEM *matrix, int width, int height, int solvew, unsigned int row_weight[], unsigned int col_weight[], int erasure_pos[]){
     int i, j, k, m, p;
-    int logline[width+1][2];
+    int (*logline)[2]= malloc(2*(width+1)*sizeof(int));
 
     for(p=i=0; i<solvew; i++){
         int bestweight= height+1;
@@ -113,7 +113,7 @@ static int inverse(ELEM *matrix, int wid
             p++;
         }
     }
-
+    free(logline);
     return p;
 }
 


More information about the Mndiff-dev mailing list