]> git.proxmox.com Git - qemu.git/blobdiff - hw/sb16.c
pthreads-based audio and miscellaneous audio clean-up (malc).
[qemu.git] / hw / sb16.c
index effbfbcf8d848f888a74cad0aa94c06fda3e794e..c22de7a7150c9b7729733344308dccd9e7ddff50 100644 (file)
--- a/hw/sb16.c
+++ b/hw/sb16.c
@@ -1193,6 +1193,12 @@ static int SB_read_DMA (void *opaque, int nchan, int dma_pos, int dma_len)
     SB16State *s = opaque;
     int till, copy, written, free;
 
+    if (s->block_size <= 0) {
+        dolog ("invalid block size=%d nchan=%d dma_pos=%d dma_len=%d\n",
+               s->block_size, nchan, dma_pos, dma_len);
+        return dma_pos;
+    }
+
     if (s->left_till_irq < 0) {
         s->left_till_irq = s->block_size;
     }