xiph / flac

Free Lossless Audio Codec
https://xiph.org/flac/
GNU Free Documentation License v1.3
1.58k stars 278 forks source link

Fix fallback to frame header bps. #707

Closed kgroeneveld closed 1 month ago

kgroeneveld commented 1 month ago

Commit d4daa86167b1 ("Check for bps% 8 != 0 if no streaminfo is present") breaks fallback to frame header bps as it tests decoder_session->bps at a point where it is guaranteed to be 0 as this is the else case of the if(decoder_session->bps) block.

Some corrupted FLAC files that used to play before the above mentioned commit no longer can be played.

Move decoder_session->bps = bps to before the decoder_session->bps validation to restore functionality more similar to before.

ktmf01 commented 1 month ago

Thanks!