From 6a0990615de61e2145010e0a7d4ee6885f3c070e Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 17 Oct 2021 00:38:25 -0600 Subject: [PATCH] dticon: make sure min_x and min_y are within icon to avoid a segfault. --- cde/programs/dticon/utils.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cde/programs/dticon/utils.c b/cde/programs/dticon/utils.c index 87d6f07cf..7a4d42757 100644 --- a/cde/programs/dticon/utils.c +++ b/cde/programs/dticon/utils.c @@ -837,6 +837,12 @@ Transfer_Back_Image( max_x = ((x1 > x2) ? x1 : x2); max_y = ((y1 > y2) ? y1 : y2); +/*** make sure min_x and min_y are within icon ***/ + if (min_x < 0) + min_x = 0; + if (min_y < 0) + min_y = 0; + /*** make sure max_x and max_y are within icon ***/ if (max_x >= icon_width) max_x = icon_width-1;