Bug 16159 - small bug in audio_helper (v 7.6)?
: small bug in audio_helper (v 7.6)?
Status: UNCONFIRMED
Product: SqueezePlay
Classification: Unclassified
Component: Audio
: unspecified
: All All
: -- minor (vote)
: ---
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-28 08:39 UTC by squeeze
Modified: 2010-04-28 08:42 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description squeeze 2010-04-28 08:39:48 UTC
I think there might be an overflow bug in audio_helper:

$ svn diff audio_helper.c 
Index: audio_helper.c
===================================================================
--- audio_helper.c	(revision 8736)
+++ audio_helper.c	(working copy)
@@ -72,7 +72,7 @@
 
 
 static inline s16_t s16_clip(s16_t a, s16_t b) {
-	s32_t s = a + b;
+    s32_t s = (s32_t)a + (s32_t)b;
 
 	if (s < -0x8000) {
 		return -0x8000;

since the rvalue will still be 16bit and only promoted to 32bit at assignment.