Skip to content

Commit 5a063c1

Browse files
authored
Merge pull request #6035 from FoamyGuy/bitmap_blit_type_error
bitmap.blit type checking and raise error
2 parents d4c2ffe + dc01505 commit 5a063c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

shared-bindings/displayio/Bitmap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg
222222
int16_t x = args[ARG_x].u_int;
223223
int16_t y = args[ARG_y].u_int;
224224

225-
displayio_bitmap_t *source = MP_OBJ_TO_PTR(args[ARG_source].u_obj);
225+
displayio_bitmap_t *source = mp_arg_validate_type(args[ARG_source].u_obj, &displayio_bitmap_type, MP_QSTR_source_bitmap);
226+
226227

227228
// ensure that the target bitmap (self) has at least as many `bits_per_value` as the source
228229
if (self->bits_per_value < source->bits_per_value) {

0 commit comments

Comments
 (0)