From ca119534173fe0d23448815d0f0d83dc5894fa72 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Tue, 15 Dec 2020 11:47:41 +0000 Subject: [PATCH] evas: Prevent null pointer access Summary: add null check Test Plan: N/A Reviewers: Hermet, cedric, kimcinoo, raster Reviewed By: raster Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12213 Change-Id: I9b34ccbeaa2df3fc97e707c35d0d8e7e34c32f24 --- src/lib/evas/common/evas_convert_colorspace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/evas/common/evas_convert_colorspace.c b/src/lib/evas/common/evas_convert_colorspace.c index afbac8f..eaa365b 100644 --- a/src/lib/evas/common/evas_convert_colorspace.c +++ b/src/lib/evas/common/evas_convert_colorspace.c @@ -27,6 +27,7 @@ evas_common_convert_rgb565_a5p_to_argb8888(void *data, int w, int h, int stride, src = data; end = src + (stride * h); ret = malloc(w * h * sizeof(DATA32)); + if (!ret) return NULL; dst = ret; if (has_alpha) @@ -55,6 +56,7 @@ evas_common_convert_agry88_to_argb8888(const void *data, int w, int h, int strid src = data; end = src + ((stride >> 1) * h); ret = malloc(w * h * sizeof(DATA32)); + if (!ret) return NULL; dst = ret; if (has_alpha) @@ -97,6 +99,7 @@ evas_common_convert_gry8_to_argb8888(const void *data, int w, int h, int stride, src = data; end = src + (stride * h); ret = malloc(w * h * sizeof(DATA32)); + if (!ret) return NULL; dst = ret; if (has_alpha) -- 2.7.4