Fix memset not memsetting all channels on failure

This commit is contained in:
bnnm 2017-11-24 23:42:11 +01:00
parent a974c756b0
commit 2a312e8562
2 changed files with 2 additions and 2 deletions

View File

@ -238,7 +238,7 @@ static void decode_mpeg_standard(VGMSTREAMCHANNEL *stream, mpeg_codec_data * dat
/* end of stream, fill rest with 0s */
if (!data->bytes_in_buffer) {
memset(outbuf + samples_done * channels, 0, (samples_to_do - samples_done) * sizeof(sample));
memset(outbuf + samples_done * channels, 0, (samples_to_do - samples_done) * channels * sizeof(sample));
break;
}

View File

@ -164,7 +164,7 @@ void decode_vorbis_custom(VGMSTREAM * vgmstream, sample * outbuf, int32_t sample
decode_fail:
/* on error just put some 0 samples */
memset(outbuf + samples_done * channels, 0, (samples_to_do - samples_done) * sizeof(sample));
memset(outbuf + samples_done * channels, 0, (samples_to_do - samples_done) * channels * sizeof(sample));
}
/* converts from internal Vorbis format to standard PCM (mostly from Xiph's decoder_example.c) */