From bc2fb11d2f1c400d0401b9683bf1970a982f5a20 Mon Sep 17 00:00:00 2001 From: dyamy-lee Date: Tue, 9 Feb 2021 13:30:57 +0900 Subject: [PATCH] base_gui_direct : resolve the dereference before null check Change-Id: Ic87c7df629929e3fda5ab422092c5a7c334d2f38 --- base/base_gui_direct.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/base/base_gui_direct.c b/base/base_gui_direct.c index b951bed..676ad35 100644 --- a/base/base_gui_direct.c +++ b/base/base_gui_direct.c @@ -385,13 +385,19 @@ void _copy_buffers_by_rotate(void *srcptr, int srcw, int srch, int srcstride, src_img = pixman_image_create_bits(PIXMAN_a8r8g8b8, buf_width, srch, (uint32_t*)srcptr, srcstride); if(!src_img) { - LOG("No source image.\n"); + LOG("Failed to create src pixman.\n"); return; } buf_width = dststride/4; dst_img = pixman_image_create_bits(PIXMAN_a8r8g8b8, buf_width, dsth, (uint32_t*)dstptr, dststride); + if(!dst_img) { + LOG("Failed to create dst pixman\n"); + pixman_image_unref(src_img); + return; + } + struct pixman_f_transform ft; double scale_x, scale_y; pixman_transform_t t; -- 2.34.1