mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 10:40:00 +08:00
Fixed divide by zero segault (#461)
Check if inner_size is less than 1 to prevent divide by 0 segfault. Co-authored-by: Arthur Sonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
parent
7cc68cfbd0
commit
251306a4bb
@ -40,6 +40,9 @@ Element vscroll_indicator(Element child) {
|
|||||||
const Box& stencil = screen.stencil;
|
const Box& stencil = screen.stencil;
|
||||||
|
|
||||||
int size_inner = box_.y_max - box_.y_min;
|
int size_inner = box_.y_max - box_.y_min;
|
||||||
|
if (size_inner <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
int size_outter = stencil.y_max - stencil.y_min + 1;
|
int size_outter = stencil.y_max - stencil.y_min + 1;
|
||||||
if (size_outter >= size_inner) {
|
if (size_outter >= size_inner) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user