From patchwork Fri Mar 26 16:06:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 48703 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7A7CCB7CF3 for ; Sat, 27 Mar 2010 06:07:54 +1100 (EST) Received: from localhost ([127.0.0.1]:54975 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvDhr-0004v2-Vg for incoming@patchwork.ozlabs.org; Fri, 26 Mar 2010 13:52:28 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvC5p-0004M9-3j for qemu-devel@nongnu.org; Fri, 26 Mar 2010 12:09:05 -0400 Received: from [140.186.70.92] (port=41588 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvC4U-0003dC-4Z for qemu-devel@nongnu.org; Fri, 26 Mar 2010 12:09:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvC4A-0006se-4q for qemu-devel@nongnu.org; Fri, 26 Mar 2010 12:07:23 -0400 Received: from afflict.kos.to ([92.243.29.197]:33612) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvC49-0006sH-US for qemu-devel@nongnu.org; Fri, 26 Mar 2010 12:07:22 -0400 Received: by afflict.kos.to (Postfix, from userid 1000) id C662526593; Fri, 26 Mar 2010 16:07:20 +0000 (UTC) From: Riku Voipio To: qemu-devel@nongnu.org Date: Fri, 26 Mar 2010 16:06:25 +0000 Message-Id: X-Mailer: git-send-email 1.6.5 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Riku Voipio , =?UTF-8?q?Juha=20Riihim=C3=A4ki?= Subject: [Qemu-devel] [PATCH 04/48] audio: fix integer overflow expression X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Juha Riihimäki Signed-Off-By: Riku Voipio Signed-Off-By: Juha Riihimäki --- audio/mixeng_template.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/mixeng_template.h b/audio/mixeng_template.h index 5617705..80af364 100644 --- a/audio/mixeng_template.h +++ b/audio/mixeng_template.h @@ -56,7 +56,7 @@ static mixeng_real inline glue (conv_, ET) (IN_T v) #endif #else /* !RECIPROCAL */ #ifdef SIGNED - return nv / (mixeng_real) (IN_MAX - IN_MIN); + return nv / (mixeng_real) ((mixeng_real)IN_MAX - (mixeng_real)IN_MIN); #else return (nv - HALF) / (mixeng_real) IN_MAX; #endif @@ -73,7 +73,7 @@ static IN_T inline glue (clip_, ET) (mixeng_real v) } #ifdef SIGNED - return ENDIAN_CONVERT ((IN_T) (v * (IN_MAX - IN_MIN))); + return ENDIAN_CONVERT ((IN_T) (v * ((mixeng_real)IN_MAX - (mixeng_real)IN_MIN))); #else return ENDIAN_CONVERT ((IN_T) ((v * IN_MAX) + HALF)); #endif