qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] audio: st_rate_flow exist a dead loop


From: Peng Hao
Subject: [Qemu-devel] [PATCH] audio: st_rate_flow exist a dead loop
Date: Wed, 5 Jul 2017 07:44:27 +0800

From: Hao Peng <address@hidden>

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 <address@hidden>
Reviewed-by: Liu Yun <address@hidden>
Reviewed-by: Wang Yechao <address@hidden>
---
 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 <= (rate->opos >> 32)) {
             ilast = *ibuf++;
             rate->ipos++;
+            /* if ipos reversal, there is  a dead loop */
+            if (rate->ipos == 0xffffffff) {
+                rate->ipos = 1;
+                rate->opos = rate->opos & 0xffffffff;
+            }
             /* See if we finished the input buffer yet */
             if (ibuf >= iend) {
                 goto the_end;
-- 
1.8.3.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]