diff --git a/src/vgmstream.c b/src/vgmstream.c index 4cbb8409..a86e11be 100644 --- a/src/vgmstream.c +++ b/src/vgmstream.c @@ -3386,6 +3386,9 @@ int get_vgmstream_average_bitrate(VGMSTREAM * vgmstream) int length_samples = vgmstream->num_samples; 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);