shithub: opusfile

Download patch

ref: fc3e5de1a1d68b686f6369aeedcfa0be45e2a294
parent: ef966d3ba278c2341282c76c785c21866354d114
author: Timothy B. Terriberry <tterribe@xiph.org>
date: Fri Jan 10 11:43:20 EST 2014

Fix an llvm signed overflow warning.

Thanks to gmaxwell for the report.

--- a/src/info.c
+++ b/src/info.c
@@ -28,11 +28,13 @@
 }
 
 static opus_uint32 op_parse_uint32le(const unsigned char *_data){
-  return _data[0]|_data[1]<<8|_data[2]<<16|_data[3]<<24;
+  return _data[0]|(opus_uint32)_data[1]<<8|
+   (opus_uint32)_data[2]<<16|(opus_uint32)_data[3]<<24;
 }
 
 static opus_uint32 op_parse_uint32be(const unsigned char *_data){
-  return _data[3]|_data[2]<<8|_data[1]<<16|_data[0]<<24;
+  return _data[3]|(opus_uint32)_data[2]<<8|
+   (opus_uint32)_data[1]<<16|(opus_uint32)_data[0]<<24;
 }
 
 int opus_head_parse(OpusHead *_head,const unsigned char *_data,size_t _len){