From 8247dfc47577b87dc6348d58e346fd5a19659430 Mon Sep 17 00:00:00 2001 From: Dragos Oancea Date: Fri, 31 Jan 2020 23:43:37 +0000 Subject: [PATCH] [core] scan-build: Dereference of null pointer (loaded from variable 'txt') - switch_img_write_text_img() --- src/switch_core_video.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/switch_core_video.c b/src/switch_core_video.c index 5f6d4902ef..f7352bb0f9 100644 --- a/src/switch_core_video.c +++ b/src/switch_core_video.c @@ -2139,6 +2139,10 @@ SWITCH_DECLARE(switch_image_t *) switch_img_write_text_img(int w, int h, switch_ switch_image_t *txtimg = NULL; int x = 0, y = 0; + if (!duptxt) { + return NULL; + } + if (strchr(text, ':')) { argc = switch_split(duptxt, ':', argv);