From d33a522936a97b92c21fc3010a068f481ecf28a3 Mon Sep 17 00:00:00 2001 From: Rene Kita Date: Sun, 13 Feb 2022 10:51:06 +0100 Subject: [PATCH] Fix potential null pointer dereference --- w3mimg/fb/fb_imlib2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/w3mimg/fb/fb_imlib2.c b/w3mimg/fb/fb_imlib2.c index 1a5151c..477d385 100644 --- a/w3mimg/fb/fb_imlib2.c +++ b/w3mimg/fb/fb_imlib2.c @@ -84,6 +84,9 @@ draw(FB_IMAGE * img, Imlib_Image image) imlib_context_set_image(image); data = imlib_image_get_data_for_reading_only(); + if (data == NULL) + return; + for (j = 0; j < img->height; j++) { offset = img->width * j; for (i = 0; i < img->width; i++) {