From c6e53da21bcc7c80e9de94c95212c531cd075cb1 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Thu, 25 Aug 2005 00:22:06 +0000 Subject: [PATCH] fix bug in utf8len() --- src/libFLAC/format.c | 2 +- src/plugin_common/tags.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libFLAC/format.c b/src/libFLAC/format.c index 42e0903..5f14d68 100644 --- a/src/libFLAC/format.c +++ b/src/libFLAC/format.c @@ -267,7 +267,7 @@ static __inline unsigned utf8len_(const FLAC__byte *utf8) return 1; } else if ((utf8[0] & 0xE0) == 0xC0 && (utf8[1] & 0xC0) == 0x80) { - if ((utf8[0] & 0x01) == 0xC0) /* overlong sequence check */ + if ((utf8[0] & 0xFE) == 0xC0) /* overlong sequence check */ return 0; return 2; } diff --git a/src/plugin_common/tags.c b/src/plugin_common/tags.c index f580f44..1eec636 100644 --- a/src/plugin_common/tags.c +++ b/src/plugin_common/tags.c @@ -46,7 +46,7 @@ static __inline unsigned local__utf8len(const FLAC__byte *utf8) return 1; } else if ((utf8[0] & 0xE0) == 0xC0 && (utf8[1] & 0xC0) == 0x80) { - if ((utf8[0] & 0x01) == 0xC0) /* overlong sequence check */ + if ((utf8[0] & 0xFE) == 0xC0) /* overlong sequence check */ return 0; return 2; } -- 2.7.4