mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-29 19:37:30 +01:00
Add a guard on the bitrate calculator
This commit is contained in:
parent
d22043e0f7
commit
cf0e1c5f2b
@ -3386,6 +3386,9 @@ int get_vgmstream_average_bitrate(VGMSTREAM * vgmstream)
|
|||||||
int length_samples = vgmstream->num_samples;
|
int length_samples = vgmstream->num_samples;
|
||||||
int channels = get_vgmstream_channel_count(vgmstream);
|
int channels = get_vgmstream_channel_count(vgmstream);
|
||||||
STREAMFILE * streamFile;
|
STREAMFILE * streamFile;
|
||||||
|
|
||||||
|
if (!sample_rate || !channels || !length_samples)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (channels >= 1) {
|
if (channels >= 1) {
|
||||||
streamFile = get_vgmstream_streamfile(vgmstream, 0);
|
streamFile = get_vgmstream_streamfile(vgmstream, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user