ogg_afh_common: Fix signedness issue.
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 6 Jun 2019 06:28:58 +0000 (08:28 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 6 Jun 2019 06:40:49 +0000 (08:40 +0200)
The previous patch introduced a regression because "granule" was made
unsigned by mistake but needs to be a signed variable. This can cause
the loop in oac_get_file_info() to not terminate which eventually
results in an abort due to an allocation failure:

para_realloc: realloc failed (size = 2097152000), aborting

ogg_afh_common.c

index 4fc37952a61fcb92a8a6a9c74978b501525716bd..12a152062f2bf49beebd6d3838e3514d1ec0ee3d 100644 (file)
@@ -125,8 +125,8 @@ int oac_get_file_info(char *map, size_t numbytes, struct afh_info *afhi,
        ogg_page op;
        char *buf;
        int ret, i, j, frames_per_chunk, ct_size, prev_pageno = 0;
-       long long unsigned granule = 0, granule_skip = 0, num_frames = 0;
-       int64_t prev_granule = 0;
+       long long unsigned granule_skip = 0, num_frames = 0;
+       int64_t granule = 0, prev_granule = 0;
 
        ogg_sync_init(&oss);
        ret = -E_OGG_SYNC;