Fix outbuf only being partially cleared when trying to read after EOF

This commit is contained in:
bnnm 2017-07-29 01:25:35 +02:00
parent 8d7c52f460
commit fcf8a9485c

View File

@ -83,8 +83,8 @@ void decode_vorbis_custom(VGMSTREAM * vgmstream, sample * outbuf, int32_t sample
while (samples_done < samples_to_do) {
/* extra EOF check for edge cases */
if (stream->offset > stream_size) {
memset(outbuf + samples_done * channels, 0, (samples_to_do - samples_done) * sizeof(sample));
if (stream->offset >= stream_size) {
memset(outbuf + samples_done * channels, 0, (samples_to_do - samples_done) * sizeof(sample) * channels);
break;
}