Fix off-by-one bug in mp3_afh.
authorAndre Noll <maan@systemlinux.org>
Sun, 19 Apr 2009 21:17:08 +0000 (23:17 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 19 Apr 2009 21:17:08 +0000 (23:17 +0200)
mp3_afh.c

index 8eec436..72c5df7 100644 (file)
--- a/mp3_afh.c
+++ b/mp3_afh.c
@@ -445,7 +445,7 @@ static int mp3_read_info(unsigned char *map, size_t numbytes, int fd,
        ret = -E_MP3_INFO;
        if (!afhi->chunks_total || !freq_sum || !br_sum)
                goto err_out;
-       afhi->chunk_table[afhi->chunks_total] = numbytes - 1;
+       afhi->chunk_table[afhi->chunks_total] = numbytes;
        afhi->bitrate = br_sum / afhi->chunks_total;
        afhi->frequency = freq_sum / afhi->chunks_total;
        afhi->channels = header_channels(&header);