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