From nobody Sat May 4 19:23:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499177995904640.7055829940622; Tue, 4 Jul 2017 07:19:55 -0700 (PDT) Received: from localhost ([::1]:41652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSOgB-00024a-L3 for importer@patchew.org; Tue, 04 Jul 2017 10:19:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSIEL-0008D1-JC for qemu-devel@nongnu.org; Tue, 04 Jul 2017 03:26:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSIEH-0004H3-IJ for qemu-devel@nongnu.org; Tue, 04 Jul 2017 03:26:41 -0400 Received: from out1.zte.com.cn ([202.103.147.172]:58783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSIEG-0004AO-VF for qemu-devel@nongnu.org; Tue, 04 Jul 2017 03:26:37 -0400 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 4 Jul 2017 07:09:13 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v647P5Vu091987; Tue, 4 Jul 2017 15:25:05 +0800 (GMT-8) (envelope-from peng.hao2@zte.com.cn) Received: from localhost.localdomain ([10.74.120.79]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017070415250822-3053095 ; Tue, 4 Jul 2017 15:25:08 +0800 X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170704150913 From: Peng Hao To: kraxel@redhat.com Date: Wed, 5 Jul 2017 07:44:27 +0800 Message-Id: <1499211867-3126-1-git-send-email-peng.hao2@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-07-04 15:25:08, Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-07-04 15:25:01, Serialize complete at 2017-07-04 15:25:01 X-MAIL: mse01.zte.com.cn v647P5Vu091987 X-HQIP: 127.0.0.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 202.103.147.172 X-Mailman-Approved-At: Tue, 04 Jul 2017 10:15:41 -0400 Subject: [Qemu-devel] [PATCH] audio: st_rate_flow exist a dead loop X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hao Peng , wang.yechao255@zte.com.cn, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Hao Peng if audio device is opend for a long time in windows vm, there is a uint32_t= varaible reversal. It will result to a dead loop. Signed-off-by: Peng Hao Reviewed-by: Liu Yun Reviewed-by: Wang Yechao --- audio/rate_template.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/audio/rate_template.h b/audio/rate_template.h index bd4b1c7..1aa6c43 100644 --- a/audio/rate_template.h +++ b/audio/rate_template.h @@ -71,6 +71,11 @@ void NAME (void *opaque, struct st_sample *ibuf, struct = st_sample *obuf, while (rate->ipos <=3D (rate->opos >> 32)) { ilast =3D *ibuf++; rate->ipos++; + /* if ipos reversal, there is a dead loop */ + if (rate->ipos =3D=3D 0xffffffff) { + rate->ipos =3D 1; + rate->opos =3D rate->opos & 0xffffffff; + } /* See if we finished the input buffer yet */ if (ibuf >=3D iend) { goto the_end; --=20 1.8.3.1