]> Git Repo - qemu.git/blobdiff - audio/rate_template.h
ui: Always remove an old VNC channel watch before adding a new one
[qemu.git] / audio / rate_template.h
index bd4b1c768565cda09fdb2c3f5b3ebfbc252f1475..6e93588877d01b90acd29265f3c01c38df3c673e 100644 (file)
@@ -71,6 +71,12 @@ void NAME (void *opaque, struct st_sample *ibuf, struct st_sample *obuf,
         while (rate->ipos <= (rate->opos >> 32)) {
             ilast = *ibuf++;
             rate->ipos++;
+
+            /* if ipos overflow, there is  a infinite 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;
This page took 0.023513 seconds and 4 git commands to generate.