Merge branch 't/sync'
[paraslash.git] / ogg_afh_common.c
index cb59d36383a104836bbff4ef59f233f464ae4743..ac70eb3f0fc543a316f636c7a589cfaa60018c5c 100644 (file)
@@ -1,10 +1,10 @@
 /*
 /*
- * Copyright (C) 2004-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2004-2013 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
-/** \file ogg_afh_common.c Functions common to ogg/vorbis and ogg/speex. */
+/** \file ogg_afh_common.c Functions common to all ogg/ codecs. */
 
 #include <ogg/ogg.h>
 #include <regex.h>
 
 #include <ogg/ogg.h>
 #include <regex.h>
@@ -170,7 +170,7 @@ int ogg_get_file_info(char *map, size_t numbytes, struct afh_info *afhi,
        for (j = 1; ogg_sync_pageseek(&oss, &op) > 0; /* nothing */) {
                int granule = ogg_page_granulepos(&op);
 
        for (j = 1; ogg_sync_pageseek(&oss, &op) > 0; /* nothing */) {
                int granule = ogg_page_granulepos(&op);
 
-               while (granule > j * frames_per_chunk) {
+               while (granule >= (j + 1) * frames_per_chunk) {
                        j++;
                        if (j >= ct_size) {
                                ct_size *= 2;
                        j++;
                        if (j >= ct_size) {
                                ct_size *= 2;