Commit 2bf8cf39 authored by Michael Smith's avatar Michael Smith

UTF8 check was wrong for > 1 byte characters, since it miscalculated the

length

svn path=/trunk/vorbis-tools/; revision=3560
parent 17a20fb2
......@@ -241,16 +241,26 @@ static void vorbis_process(stream_processor *stream, ogg_page *page )
remaining = inf->vc.comment_lengths[i] - j;
if((val[j] & 0x80) == 0)
bytes = 1;
else if((val[j] & 0x40) == 0)
bytes = 2;
else if((val[j] & 0x20) == 0)
bytes = 3;
else if((val[j] & 0x10) == 0)
bytes = 4;
else if((val[j] & 0x08) == 0)
bytes = 5;
else if((val[j] & 0x04) == 0)
bytes = 6;
else if((val[j] & 0x40) == 0x40) {
if((val[j] & 0x20) == 0)
bytes = 2;
else if((val[j] & 0x10) == 0)
bytes = 3;
else if((val[j] & 0x08) == 0)
bytes = 4;
else if((val[j] & 0x04) == 0)
bytes = 5;
else if((val[j] & 0x02) == 0)
bytes = 6;
else {
warn(_("Warning: Illegal UTF-8 sequence in "
"comment %d (stream %d): length "
"marker wrong\n"),
i, stream->num);
broken = 1;
break;
}
}
else {
warn(_("Warning: Illegal UTF-8 sequence in comment "
"%d (stream %d): length marker wrong\n"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment