From: Andre Noll Date: Wed, 11 Feb 2009 21:17:42 +0000 (+0100) Subject: Do not allocate too much space for the mp3 chunk table. X-Git-Tag: v0.3.4~65 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=3ead49b77d763aae57009719b9dcc89f7a033295;p=paraslash.git Do not allocate too much space for the mp3 chunk table. The chunk_table contains an array of uint32_t values. --- diff --git a/mp3_afh.c b/mp3_afh.c index 41874b86..932a7721 100644 --- a/mp3_afh.c +++ b/mp3_afh.c @@ -403,7 +403,7 @@ static int mp3_read_info(unsigned char *map, size_t numbytes, int fd, char *taginfo; afhi->chunks_total = 0; - afhi->chunk_table = para_malloc(chunk_table_size * sizeof(size_t)); + afhi->chunk_table = para_malloc(chunk_table_size * sizeof(uint32_t)); taginfo = mp3_get_id3(map, numbytes, fd); while (1) { unsigned long freq, br, fl; @@ -433,7 +433,7 @@ static int mp3_read_info(unsigned char *map, size_t numbytes, int fd, if (afhi->chunks_total >= chunk_table_size) { chunk_table_size *= 2; afhi->chunk_table = para_realloc(afhi->chunk_table, - chunk_table_size * sizeof(size_t)); + chunk_table_size * sizeof(uint32_t)); } afhi->chunk_table[afhi->chunks_total] = fpos; // if (afhi->chunks_total < 10 || !(afhi->chunks_total % 1000))