commit bb23f79129470dfdb7f447b096bde7f4d5a78a88
parent b40d5950440d8d861899016d19dafe5bce6e9564
Author: Martin Mitas <mity@morous.org>
Date: Sun, 4 Dec 2016 18:09:33 +0100
md_build_img_alt: Fix crash when dealing with some mark types.
For some mark types, it is possible that subsequent mark has lower 'beg'
then 'end' of the previous one.
This typically happens when an opener mark is expanded to cover whole
range to the closer.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/md4c/md4c.c b/md4c/md4c.c
@@ -3288,7 +3288,7 @@ md_build_img_alt(MD_CTX* ctx, MD_MARK* mark, const MD_LINE* lines, int n_lines,
off = mark->end;
mark++;
- while(!(mark->flags & MD_MARK_RESOLVED))
+ while(!(mark->flags & MD_MARK_RESOLVED) || mark->beg < off)
mark++;
}
}