mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-29 03:32:48 +00:00
Fix issue #89 "Menu key causes crash".
We've to check the keycode returned by readkey(), it must be in the [0,KEY_MAX) range.
This commit is contained in:
parent
7771d3fb17
commit
f1180e7a71
@ -494,8 +494,10 @@ bool jmanager_generate_messages(JWidget manager)
|
|||||||
msg = jmessage_new_key_related(JM_KEYPRESSED, readkey_value);
|
msg = jmessage_new_key_related(JM_KEYPRESSED, readkey_value);
|
||||||
|
|
||||||
c = readkey_value >> 8;
|
c = readkey_value >> 8;
|
||||||
|
if (c >= 0 && c < KEY_MAX) {
|
||||||
old_readed_key[c] = key[c];
|
old_readed_key[c] = key[c];
|
||||||
msg->key.repeat = key_repeated[c]++;
|
msg->key.repeat = key_repeated[c]++;
|
||||||
|
}
|
||||||
|
|
||||||
broadcast_key_msg(manager, msg);
|
broadcast_key_msg(manager, msg);
|
||||||
jmanager_enqueue_message(msg);
|
jmanager_enqueue_message(msg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user