aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn van Beurden <mvanb1@gmail.com>2023-05-22 21:21:33 +0200
committerGitHub <noreply@github.com>2023-05-22 21:21:33 +0200
commitc8e6f7372cd0acd0bfc49609ebd711e0d754dd2f (patch)
tree60f3e80605bf434d10ab7d068893fd5982b5325a
parent9e157b5e1e426fafc9ab0791d6d5344731b1cc30 (diff)
downloadflac-c8e6f7372cd0acd0bfc49609ebd711e0d754dd2f.tar.gz
Prevent overflow when parsing RIFF fmt chunk
-rw-r--r--src/flac/encode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/flac/encode.c b/src/flac/encode.c
index 399956d9..fc05689a 100644
--- a/src/flac/encode.c
+++ b/src/flac/encode.c
@@ -327,7 +327,7 @@ static FLAC__bool get_sample_info_wave(EncoderSession *e, encode_options_t optio
}
data_bytes -= (16+8);
}
- if(data_bytes < 16) {
+ if(data_bytes < 16 || data_bytes > (UINT32_MAX-8)) {
flac__utils_printf(stderr, 1, "%s: ERROR: non-standard 'fmt ' chunk has length = %u\n", e->inbasefilename, (uint32_t)data_bytes);
return false;
}