Add a guard on the bitrate calculator

This commit is contained in:
Chris Moeller 2015-08-23 23:44:23 +00:00
parent d22043e0f7
commit cf0e1c5f2b

View File

@ -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) {