Sanify loops: ignore negative start

This commit is contained in:
bnnm 2016-12-22 23:25:18 +01:00
parent ea7b8d2570
commit 12760d2183

View File

@ -376,8 +376,9 @@ VGMSTREAM * init_vgmstream_internal(STREAMFILE *streamFile, int do_dfs) {
/* Sanify loops! */
if (vgmstream->loop_flag) {
if ((vgmstream->loop_end_sample <= vgmstream->loop_start_sample) ||
(vgmstream->loop_end_sample > vgmstream->num_samples))
if ((vgmstream->loop_end_sample <= vgmstream->loop_start_sample)
|| (vgmstream->loop_end_sample > vgmstream->num_samples)
|| (vgmstream->loop_start_sample < 0) )
vgmstream->loop_flag = 0;
}