Fix Scrolling Textures Crash
This commit is contained in:
parent
7ab8b7aaa0
commit
ed0b8b177f
|
@ -24,6 +24,7 @@ struct ScrollTarget *get_scroll_targets(u32 id, u16 size, u16 offset) {
|
||||||
if ((!scroll->hasOffset && offset > 0) || size < scroll->size) {
|
if ((!scroll->hasOffset && offset > 0) || size < scroll->size) {
|
||||||
if (scroll->hasOffset) { return NULL; }
|
if (scroll->hasOffset) { return NULL; }
|
||||||
if (size > scroll->size) { size = scroll->size; } // Don't use an invalid size
|
if (size > scroll->size) { size = scroll->size; } // Don't use an invalid size
|
||||||
|
if (size + offset >= scroll->size) { return NULL; } // If the offset is invalid, Abort.
|
||||||
scroll->hasOffset = true;
|
scroll->hasOffset = true;
|
||||||
Vtx* *newVtx = calloc(size, sizeof(Vtx*));
|
Vtx* *newVtx = calloc(size, sizeof(Vtx*));
|
||||||
if (!newVtx) { return NULL; }
|
if (!newVtx) { return NULL; }
|
||||||
|
|
Loading…
Reference in New Issue