aboutsummaryrefslogtreecommitdiff
path: root/platform/javascript/os_javascript.cpp
diff options
context:
space:
mode:
authorHein-Pieter van Braam2017-08-21 19:36:40 +0200
committerRémi Verschelde2017-08-27 12:56:05 +0200
commitbec8fd17320cec0ff0a49087aa5cbb8f12742049 (patch)
tree6ba247e3852643e0854e9df108119bb856078dc8 /platform/javascript/os_javascript.cpp
parente8fb68e038bddbb82653550cd2854fc5c5d6891b (diff)
downloadgodot-bec8fd17320cec0ff0a49087aa5cbb8f12742049.tar.gz
godot-bec8fd17320cec0ff0a49087aa5cbb8f12742049.tar.zst
godot-bec8fd17320cec0ff0a49087aa5cbb8f12742049.zip
Fix color_ramp indexing negative elements
The 'pos' variable passed to get_color() and get_offset() can be negative if the color ramp itself is empty. This causes a lookup in an empty position in the color Vector which leads to a crash. We add a check so we never do a lookup in the color Vector if the gradient is empty. This fixes #10501 (cherry picked from commit 67b9d6eef2df5253657c89725195c58fe01b39f0)
Diffstat (limited to 'platform/javascript/os_javascript.cpp')
0 files changed, 0 insertions, 0 deletions