From: Andre Noll Date: Thu, 6 Jun 2019 06:28:58 +0000 (+0200) Subject: ogg_afh_common: Fix signedness issue. X-Git-Tag: v0.6.3~28^2~1 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=b223b30fd6ecea80100b1d4a6802cef0e9c29e49;hp=16f2ff3d3a6951588cd7a4ba1b33832a07b8652b ogg_afh_common: Fix signedness issue. 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 --- diff --git a/ogg_afh_common.c b/ogg_afh_common.c index 4fc37952..12a15206 100644 --- a/ogg_afh_common.c +++ b/ogg_afh_common.c @@ -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;