Merge pull request #8434 from rimwolf-redux/bitmap

Fixed displayio/Bitmap value_count range check
This commit is contained in:
Jeff Epler 2023-09-27 09:22:25 -05:00 committed by GitHub
commit 41096dddaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,5 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
@ -64,7 +66,7 @@ STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_ar
mp_arg_check_num(n_args, n_kw, 3, 3, false);
uint32_t width = mp_arg_validate_int_range(mp_obj_get_int(all_args[0]), 0, 32767, MP_QSTR_width);
uint32_t height = mp_arg_validate_int_range(mp_obj_get_int(all_args[1]), 0, 32767, MP_QSTR_height);
uint32_t value_count = mp_arg_validate_int_range(mp_obj_get_int(all_args[2]), 1, 65535, MP_QSTR_value_count);
uint32_t value_count = mp_arg_validate_int_range(mp_obj_get_int(all_args[2]), 1, 65536, MP_QSTR_value_count);
uint32_t bits = 1;
while ((value_count - 1) >> bits) {