mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
LibAudio: Don't try to resample FLAC frames with sample rate 0
Although this sample rate is more or less bogus, we might as well not crash.
This commit is contained in:
parent
2e9e0dfe61
commit
ab9c18c176
|
@ -699,6 +699,10 @@ ErrorOr<Vector<i32>, LoaderError> FlacLoaderPlugin::parse_subframe(FlacSubframeH
|
|||
samples[i] <<= subframe_header.wasted_bits_per_sample;
|
||||
}
|
||||
|
||||
// Resamplers VERIFY that the sample rate is non-zero.
|
||||
if (m_current_frame->sample_rate == 0 || m_sample_rate == 0)
|
||||
return samples;
|
||||
|
||||
ResampleHelper<i32> resampler(m_current_frame->sample_rate, m_sample_rate);
|
||||
return resampler.resample(samples);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue