summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartijn van Beurden <mvanb1@gmail.com>2022-07-26 11:29:08 +0200
committerMartijn van Beurden <mvanb1@gmail.com>2022-07-31 21:58:07 +0200
commit4e823662ec5121e84d7d5ca3aa62cf87064b229f (patch)
tree53daa5df542026be9f98319e92514bce9a105277 /src
parent10e34d444a0e0cd4aa64551f4aa2c21fe10a2df5 (diff)
downloadflac-4e823662ec5121e84d7d5ca3aa62cf87064b229f.tar.gz
Fix decoding of 33 bps constant subframe
Diffstat (limited to 'src')
-rw-r--r--src/libFLAC/stream_decoder.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
index 25f9197f..69645c40 100644
--- a/src/libFLAC/stream_decoder.c
+++ b/src/libFLAC/stream_decoder.c
@@ -2659,7 +2659,6 @@ FLAC__bool read_subframe_constant_(FLAC__StreamDecoder *decoder, uint32_t channe
FLAC__Subframe_Constant *subframe = &decoder->private_->frame.subframes[channel].data.constant;
FLAC__int64 x;
uint32_t i;
- FLAC__int32 *output = decoder->private_->output[channel];
decoder->private_->frame.subframes[channel].type = FLAC__SUBFRAME_TYPE_CONSTANT;
@@ -2670,8 +2669,16 @@ FLAC__bool read_subframe_constant_(FLAC__StreamDecoder *decoder, uint32_t channe
/* decode the subframe */
if(do_full_decode) {
- for(i = 0; i < decoder->private_->frame.header.blocksize; i++)
- output[i] = x;
+ if(bps <= 32) {
+ FLAC__int32 *output = decoder->private_->output[channel];
+ for(i = 0; i < decoder->private_->frame.header.blocksize; i++)
+ output[i] = x;
+ } else {
+ FLAC__int64 *output = decoder->private_->side_subframe;
+ decoder->private_->side_subframe_in_use = true;
+ for(i = 0; i < decoder->private_->frame.header.blocksize; i++)
+ output[i] = x;
+ }
}
return true;