summaryrefslogtreecommitdiffstats
path: root/Source/cm_utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cm_utf8.c')
-rw-r--r--Source/cm_utf8.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cm_utf8.c b/Source/cm_utf8.c
index 2459c02..d41d097 100644
--- a/Source/cm_utf8.c
+++ b/Source/cm_utf8.c
@@ -76,6 +76,11 @@ const char* cm_utf8_decode_character(const char* first, const char* last,
return 0;
}
+ /* Invalid codepoints. */
+ if (0x10FFFF < uc) {
+ return 0;
+ }
+
*pc = uc;
return first;
}