ALSA: ali5451: Fix out-of-bound position reporting
[pandora-kernel.git] / sound / pci / ali5451 / ali5451.c
index be662c9..8e935de 100644 (file)
@@ -1422,6 +1422,7 @@ snd_ali_playback_pointer(struct snd_pcm_substream *substream)
        spin_unlock(&codec->reg_lock);
        snd_ali_printk("playback pointer returned cso=%xh.\n", cso);
 
+       cso %= runtime->buffer_size;
        return cso;
 }
 
@@ -1442,6 +1443,7 @@ static snd_pcm_uframes_t snd_ali_pointer(struct snd_pcm_substream *substream)
        cso = inw(ALI_REG(codec, ALI_CSO_ALPHA_FMS + 2));
        spin_unlock(&codec->reg_lock);
 
+       cso %= runtime->buffer_size;
        return cso;
 }