aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-12-23 10:20:50 +0100
committerBoris Faure <billiob@gmail.com>2018-12-23 10:20:50 +0100
commit744c93a37d79fd507e9fc0f8848a39a7ccb02a8d (patch)
tree43ee809b9659232d18165d20a6f3dfdf26f970c0 /src
parentTerminology release 1.3.2 (diff)
downloadterminology-744c93a37d79fd507e9fc0f8848a39a7ccb02a8d.tar.gz
termio: fix potential segv. CID1397077
Diffstat (limited to 'src')
-rw-r--r--src/bin/termio.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/bin/termio.c b/src/bin/termio.c
index abf6ae6..f439b1d 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -1156,19 +1156,6 @@ _cb_link_down(void *data,
ctxp = elm_ctxpopup_add(sd->win);
sd->ctxpopup = ctxp;
- if (sd->config->helper.inline_please)
- {
- Media_Type type = media_src_type_get(sd->link.string);
-
- if ((type == MEDIA_TYPE_IMG) ||
- (type == MEDIA_TYPE_SCALE) ||
- (type == MEDIA_TYPE_EDJE) ||
- (type == MEDIA_TYPE_MOV))
- elm_ctxpopup_item_append(ctxp, _("Preview"), NULL,
- _cb_ctxp_link_preview, sd->self);
- }
- elm_ctxpopup_item_append(ctxp, _("Open"), NULL, _cb_ctxp_link_open,
- sd->self);
if (hl)
{
raw_link = hl->url;
@@ -1187,6 +1174,20 @@ _cb_link_down(void *data,
if (len > 0 && raw_link[0] == '/')
absolut = EINA_TRUE;
+ if (sd->config->helper.inline_please)
+ {
+ Media_Type type = media_src_type_get(raw_link);
+
+ if ((type == MEDIA_TYPE_IMG) ||
+ (type == MEDIA_TYPE_SCALE) ||
+ (type == MEDIA_TYPE_EDJE) ||
+ (type == MEDIA_TYPE_MOV))
+ elm_ctxpopup_item_append(ctxp, _("Preview"), NULL,
+ _cb_ctxp_link_preview, sd->self);
+ }
+ elm_ctxpopup_item_append(ctxp, _("Open"), NULL, _cb_ctxp_link_open,
+ sd->self);
+
if (!absolut &&
!link_is_url(raw_link) &&
!link_is_email(raw_link))