mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 13:11:33 +00:00
- Update DUMB to revision 3aee7f113c66f19e93f9e41a6e280e12dfd9a0e9
- Fixed envelope reading to gracefully handle nodes which are out of range SVN r4116 (trunk)
This commit is contained in:
parent
cfaecc12a3
commit
3c50b1c14b
1 changed files with 7 additions and 6 deletions
|
@ -338,7 +338,7 @@ static int it_xm_read_pattern(IT_PATTERN *pattern, DUMBFILE *f, int n_channels,
|
||||||
|
|
||||||
static int it_xm_make_envelope(IT_ENVELOPE *envelope, const unsigned short *data, int y_offset)
|
static int it_xm_make_envelope(IT_ENVELOPE *envelope, const unsigned short *data, int y_offset)
|
||||||
{
|
{
|
||||||
int i, pos;
|
int i, pos, val;
|
||||||
|
|
||||||
if (envelope->n_nodes > 12) {
|
if (envelope->n_nodes > 12) {
|
||||||
/* XXX
|
/* XXX
|
||||||
|
@ -355,12 +355,13 @@ static int it_xm_make_envelope(IT_ENVELOPE *envelope, const unsigned short *data
|
||||||
pos = 0;
|
pos = 0;
|
||||||
for (i = 0; i < envelope->n_nodes; i++) {
|
for (i = 0; i < envelope->n_nodes; i++) {
|
||||||
envelope->node_t[i] = data[pos++];
|
envelope->node_t[i] = data[pos++];
|
||||||
if (data[pos] > 64) {
|
val = data[pos++];
|
||||||
TRACE("XM error: out-of-range envelope node (node_y[%d]=%d)\n", i, data[pos]);
|
if (val > 64) {
|
||||||
envelope->n_nodes = 0;
|
TRACE("XM error: out-of-range envelope node (node_y[%d]=%d)\n", i, val);
|
||||||
return -1;
|
/* FT2 seems to simply clip the value */
|
||||||
|
val = 64;
|
||||||
}
|
}
|
||||||
envelope->node_y[i] = (signed char)(data[pos++] + y_offset);
|
envelope->node_y[i] = (signed char)(val + y_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue