summaryrefslogtreecommitdiffstats
path: root/quantum/painter/qp_draw_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/painter/qp_draw_image.c')
-rw-r--r--quantum/painter/qp_draw_image.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/quantum/painter/qp_draw_image.c b/quantum/painter/qp_draw_image.c
index 9f86b29f8b..fb17a05a1b 100644
--- a/quantum/painter/qp_draw_image.c
+++ b/quantum/painter/qp_draw_image.c
@@ -90,7 +90,7 @@ painter_image_handle_t qp_load_image_mem(const void *buffer) {
bool qp_close_image(painter_image_handle_t image) {
qgf_image_handle_t *qgf_image = (qgf_image_handle_t *)image;
- if (!qgf_image->validate_ok) {
+ if (!qgf_image || !qgf_image->validate_ok) {
qp_dprintf("qp_close_image: fail (invalid image)\n");
return false;
}
@@ -210,13 +210,13 @@ static bool qp_drawimage_prepare_frame_for_stream_read(painter_device_t device,
static bool qp_drawimage_recolor_impl(painter_device_t device, uint16_t x, uint16_t y, painter_image_handle_t image, int frame_number, qgf_frame_info_t *frame_info, qp_pixel_t fg_hsv888, qp_pixel_t bg_hsv888) {
qp_dprintf("qp_drawimage_recolor: entry\n");
painter_driver_t *driver = (painter_driver_t *)device;
- if (!driver->validate_ok) {
+ if (!driver || !driver->validate_ok) {
qp_dprintf("qp_drawimage_recolor: fail (validation_ok == false)\n");
return false;
}
qgf_image_handle_t *qgf_image = (qgf_image_handle_t *)image;
- if (!qgf_image->validate_ok) {
+ if (!qgf_image || !qgf_image->validate_ok) {
qp_dprintf("qp_drawimage_recolor: fail (invalid image)\n");
return false;
}