mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-06 13:29:45 -05:00
drm backend: overflow fixes
These operations are done in 32-bit arithmetics before being casted to 64-bit, thus can overflow before the cast. Casting early fixes the issue. Found through static analysis
This commit is contained in:
parent
63eb720871
commit
f0d455f088
2 changed files with 3 additions and 3 deletions
|
|
@ -973,7 +973,7 @@ int handle_drm_event(int fd, uint32_t mask, void *data) {
|
|||
}
|
||||
|
||||
void restore_drm_outputs(struct wlr_drm_backend *drm) {
|
||||
uint64_t to_close = (1 << wl_list_length(&drm->outputs)) - 1;
|
||||
uint64_t to_close = (1L << wl_list_length(&drm->outputs)) - 1;
|
||||
|
||||
struct wlr_drm_connector *conn;
|
||||
wl_list_for_each(conn, &drm->outputs, link) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue