shithub: opusfile

Download patch

ref: 779ea4dafdf5cdbd3b0cf2bd36c1e6070a18ad39
parent: d669790560446e366ee4e3d3b0d8ad98dd579098
author: Timothy B. Terriberry <tterribe@xiph.org>
date: Tue Sep 3 10:59:26 EDT 2013

Fix a parentheses error in op_utf8_to_utf16().

For many Latin1 characters this still worked correctly by pure luck.
Unfortunately, that included my test case.

--- a/src/stream.c
+++ b/src/stream.c
@@ -162,7 +162,7 @@
           if((c0&0xE0)==0xC0){
             wchar_t w;
             /*Start byte says this is a 2-byte sequence.*/
-            w=c0&0x1F<<6|c1&0x3F;
+            w=(c0&0x1F)<<6|c1&0x3F;
             if(w>=0x80U){
               /*This is a 2-byte sequence that is not overlong.*/
               dst[di++]=w;