From d34489c47870196d90a2ebeacfa9fe4f78e0065e Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Sat, 31 Aug 2024 20:56:10 +0200 Subject: [PATCH] Fix overflow when skipping over raw input (#737) Fixes https://github.com/xiph/flac/issues/655 --- src/flac/encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flac/encode.c b/src/flac/encode.c index f12b9ce8..11ea381a 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -1129,7 +1129,7 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena switch(options.format) { case FORMAT_RAW: { - uint32_t skip_bytes = encoder_session.info.bytes_per_wide_sample * (uint32_t)skip; + uint64_t skip_bytes = encoder_session.info.bytes_per_wide_sample * skip; if(skip_bytes > lookahead_length) { skip_bytes -= lookahead_length; lookahead_length = 0;