summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn van Beurden <mvanb1@gmail.com>2022-10-10 22:52:57 +0200
committerMartijn van Beurden <mvanb1@gmail.com>2022-10-12 20:37:18 +0200
commitbb400ec5a4e234935ae493fdc41b2b8f9fb622d7 (patch)
tree4884c0053249d7f7f8883bc6a7424d46fbe77160
parentbc0173fe5fa390ff751171f28b0e68c6b4bf951c (diff)
downloadflac-bb400ec5a4e234935ae493fdc41b2b8f9fb622d7.tar.gz
Prevent division by zero when preparing apodizations
-rw-r--r--src/libFLAC/stream_encoder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
index 579a0dfd..aae0bf36 100644
--- a/src/libFLAC/stream_encoder.c
+++ b/src/libFLAC/stream_encoder.c
@@ -2646,7 +2646,7 @@ FLAC__bool resize_buffers_(FLAC__StreamEncoder *encoder, uint32_t new_blocksize)
/* now adjust the windows if the blocksize has changed */
#ifndef FLAC__INTEGER_ONLY_LIBRARY
- if(encoder->protected_->max_lpc_order > 0) {
+ if(encoder->protected_->max_lpc_order > 0 && new_blocksize > 1) {
for(i = 0; i < encoder->protected_->num_apodizations; i++) {
switch(encoder->protected_->apodizations[i].type) {
case FLAC__APODIZATION_BARTLETT: