encoder/flac: fix crash with 32 bit playback
Copy to encoder->audio_format *after* adjusting the sample format to S24_P32. Fixes http://bugs.musicpd.org/view.php?id=4433
This commit is contained in:
parent
205fba74cf
commit
4e3d182189
2
NEWS
2
NEWS
|
@ -1,6 +1,8 @@
|
|||
ver 0.19.11 (not yet released)
|
||||
* tags
|
||||
- ape: fix buffer overflow
|
||||
* encoder
|
||||
- flac: fix crash with 32 bit playback
|
||||
|
||||
ver 0.19.10 (2015/06/21)
|
||||
* input
|
||||
|
|
|
@ -157,8 +157,6 @@ flac_encoder_open(Encoder *_encoder, AudioFormat &audio_format, Error &error)
|
|||
struct flac_encoder *encoder = (struct flac_encoder *)_encoder;
|
||||
unsigned bits_per_sample;
|
||||
|
||||
encoder->audio_format = audio_format;
|
||||
|
||||
/* FIXME: flac should support 32bit as well */
|
||||
switch (audio_format.format) {
|
||||
case SampleFormat::S8:
|
||||
|
@ -178,6 +176,8 @@ flac_encoder_open(Encoder *_encoder, AudioFormat &audio_format, Error &error)
|
|||
audio_format.format = SampleFormat::S24_P32;
|
||||
}
|
||||
|
||||
encoder->audio_format = audio_format;
|
||||
|
||||
/* allocate the encoder */
|
||||
encoder->fse = FLAC__stream_encoder_new();
|
||||
if (encoder->fse == nullptr) {
|
||||
|
|
Loading…
Reference in New Issue