From 33285904abb65a729a1fa58249493ec027a43e5b Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Sat, 4 May 2002 17:40:01 +0000 Subject: [PATCH] update max sample rate checking --- src/libFLAC/stream_encoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c index c0012fde..278bf118 100644 --- a/src/libFLAC/stream_encoder.c +++ b/src/libFLAC/stream_encoder.c @@ -282,7 +282,7 @@ FLAC__StreamEncoderState FLAC__stream_encoder_init(FLAC__StreamEncoder *encoder) if(encoder->protected_->bits_per_sample < FLAC__MIN_BITS_PER_SAMPLE || encoder->protected_->bits_per_sample > FLAC__MAX_BITS_PER_SAMPLE) return encoder->protected_->state = FLAC__STREAM_ENCODER_INVALID_BITS_PER_SAMPLE; - if(encoder->protected_->sample_rate == 0 || encoder->protected_->sample_rate > FLAC__MAX_SAMPLE_RATE) + if(!FLAC__format_is_valid_sample_rate(encoder->protected_->sample_rate)) return encoder->protected_->state = FLAC__STREAM_ENCODER_INVALID_SAMPLE_RATE; if(encoder->protected_->blocksize < FLAC__MIN_BLOCK_SIZE || encoder->protected_->blocksize > FLAC__MAX_BLOCK_SIZE) @@ -461,7 +461,7 @@ FLAC__StreamEncoderState FLAC__stream_encoder_init(FLAC__StreamEncoder *encoder) return encoder->protected_->state = FLAC__STREAM_ENCODER_INVALID_SEEK_TABLE; seek_table_block.type = FLAC__METADATA_TYPE_SEEKTABLE; seek_table_block.is_last = (encoder->protected_->padding == 0 && encoder->protected_->last_metadata_is_last); - seek_table_block.length = encoder->protected_->seek_table->num_points * FLAC__STREAM_METADATA_SEEKPOINT_LEN; + seek_table_block.length = encoder->protected_->seek_table->num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH; seek_table_block.data.seek_table = *encoder->protected_->seek_table; if(!FLAC__add_metadata_block(&seek_table_block, encoder->private_->frame)) return encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR;