/[pkgs]/rpms/kernel/F-10/alsa-pcm-safer-boundary-checks.patch
ViewVC logotype

Contents of /rpms/kernel/F-10/alsa-pcm-safer-boundary-checks.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Mon Apr 13 18:21:11 2009 UTC (7 months, 1 week ago) by cebbert
Branch: MAIN
CVS Tags: kernel-2_6_29_1-41_fc10, kernel-2_6_29_3-60_fc10, kernel-2_6_29_6-99_fc10, kernel-2_6_29_1-42_fc10, kernel-2_6_29_6-93_fc10, kernel-2_6_29_2-45_rc1_fc10, kernel-2_6_29_2-48_rc1_fc10, kernel-2_6_29_6-97_fc10, kernel-2_6_29_5-84_fc10, kernel-2_6_29_2-55_fc10, kernel-2_6_29_2-52_fc10, kernel-2_6_29_1-36_fc10, kernel-2_6_29_4-72_fc10, kernel-2_6_29_5-88_fc10, kernel-2_6_29_4-75_fc10, kernel-2_6_29_4-80_fc10, kernel-2_6_29_1-30_fc10, kernel-2_6_29_1-38_fc10, HEAD
File MIME type: text/x-patch
Copy ALSA pulseaudio fixes from F-11.
1 From: Takashi Iwai <tiwai@suse.de>
2 Date: Fri, 20 Mar 2009 15:26:15 +0000 (+0100)
3 Subject: ALSA: pcm - Safer boundary checks
4 X-Git-Url: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff_plain;h=d9b59892fb7108f6ee33a4fcdc257587b68f2ed6
5
6 ALSA: pcm - Safer boundary checks
7
8 Make the boundary checks a bit safer.
9 These caese are rare or theoretically won't happen, but nothing
10 bad to keep the checks safer...
11
12 Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
14 ---
15
16 diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
17 index 063c675..fbb2e39 100644
18 --- a/sound/core/pcm_lib.c
19 +++ b/sound/core/pcm_lib.c
20 @@ -222,8 +222,9 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
21 hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size;
22 delta = new_hw_ptr - hw_ptr_interrupt;
23 if (hw_ptr_interrupt >= runtime->boundary) {
24 - hw_ptr_interrupt %= runtime->boundary;
25 - if (!hw_base) /* hw_base was already lapped; recalc delta */
26 + hw_ptr_interrupt -= runtime->boundary;
27 + if (hw_base < runtime->boundary / 2)
28 + /* hw_base was already lapped; recalc delta */
29 delta = new_hw_ptr - hw_ptr_interrupt;
30 }
31 if (delta < 0) {
32 @@ -241,7 +242,7 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
33 delta = 0;
34 } else {
35 hw_base += runtime->buffer_size;
36 - if (hw_base == runtime->boundary)
37 + if (hw_base >= runtime->boundary)
38 hw_base = 0;
39 new_hw_ptr = hw_base + pos;
40 }
41 @@ -296,7 +297,7 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
42 return 0;
43 }
44 hw_base += runtime->buffer_size;
45 - if (hw_base == runtime->boundary)
46 + if (hw_base >= runtime->boundary)
47 hw_base = 0;
48 new_hw_ptr = hw_base + pos;
49 }

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2