[vlc-commits] EnsureUTF8: fix overlong detection (refs #4725)

Rémi Denis-Courmont git at videolan.org
Sat Apr 30 15:42:58 CEST 2011


vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Apr 30 16:42:07 2011 +0300| [c5c07d263ff877f149220dc0eedfbc336ff490d9] | committer: Rémi Denis-Courmont

EnsureUTF8: fix overlong detection (refs #4725)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=c5c07d263ff877f149220dc0eedfbc336ff490d9
---

 src/text/unicode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/text/unicode.c b/src/text/unicode.c
index 0d86618..e3a29dd 100644
--- a/src/text/unicode.c
+++ b/src/text/unicode.c
@@ -334,7 +334,7 @@ static char *CheckUTF8( char *str, char rep )
             case 2:
                 if (cp < 128) // ASCII overlong
                     goto error;
-                if (cp < (1u << (5 * charlen - 3))) // overlong
+                if (cp < (1u << (5 * charlen - 4))) // overlong
                     goto error;
         }
         ptr += charlen;



More information about the vlc-commits mailing list