mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +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
1 changed files with 4 additions and 0 deletions
|
@ -699,6 +699,10 @@ ErrorOr<Vector<i32>, LoaderError> FlacLoaderPlugin::parse_subframe(FlacSubframeH
|
||||||
samples[i] <<= subframe_header.wasted_bits_per_sample;
|
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);
|
ResampleHelper<i32> resampler(m_current_frame->sample_rate, m_sample_rate);
|
||||||
return resampler.resample(samples);
|
return resampler.resample(samples);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue