Skip to content

Commit 52be2b8

Browse files
FoamyGuygamblor21
andauthored
fix out of range
Co-authored-by: Mark <[email protected]>
1 parent 3419b11 commit 52be2b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared-module/_pixelmap/PixelMap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void shared_module_pixelmap_pixelmap_setitem(pixelmap_pixelmap_obj_t *self, mp_i
165165
}
166166

167167
mp_obj_t shared_module_pixelmap_pixelmap_getitem(pixelmap_pixelmap_obj_t *self, mp_int_t i) {
168-
mp_arg_validate_index_range(i, 0, self->len, MP_QSTR_index);
168+
mp_arg_validate_index_range(i, 0, self->len - 1, MP_QSTR_index);
169169
mp_obj_t item = self->items[i];
170170
if (mp_obj_is_small_int(item)) {
171171
return common_hal_adafruit_pixelbuf_pixelbuf_get_pixel(self->pixelbuf, MP_OBJ_SMALL_INT_VALUE(item));

0 commit comments

Comments
 (0)