summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Green <josh@resonance.org>2008-06-07 10:10:49 +0200
committerTakashi Iwai <tiwai@suse.de>2008-06-07 10:10:49 +0200
commit2076b88a77d2b3ce627b622a5e5dd0f995f0da70 (patch)
tree87134908ed34e5424aaf2eea5c9e48547c60acaf
parent1467f4e238c7accd15ad57e7438ea5cbdc7ac86c (diff)
downloadalsa-lib-2076b88a77d2b3ce627b622a5e5dd0f995f0da70.tar.gz
Fix segfault with dmix of 3-bytes formats
The i386 and x86-64 dmix may cause segfaults when 3-bytes formats are used due to btsl asm code, which may overcome the buffer end-boundary. The patch changes btsl to btsw so that it doesn't happen. ALSA bug#3341: https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3341 Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--src/pcm/pcm_dmix_i386.h4
-rw-r--r--src/pcm/pcm_dmix_x86_64.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/pcm/pcm_dmix_i386.h b/src/pcm/pcm_dmix_i386.h
index 1ae037ae..9ea155d9 100644
--- a/src/pcm/pcm_dmix_i386.h
+++ b/src/pcm/pcm_dmix_i386.h
@@ -400,7 +400,7 @@ static void MIX_AREAS_24(unsigned int size,
"\tmovzwl (%%esi), %%ecx\n"
"\tmovl (%%ebx), %%edx\n"
"\tsall $16, %%eax\n"
- "\t" LOCK_PREFIX "btsl $0, (%%edi)\n"
+ "\t" LOCK_PREFIX "btsw $0, (%%edi)\n"
"\tleal (%%ecx,%%eax,1), %%ecx\n"
"\tjc 2f\n"
"\t" XSUB " %%edx, %%ecx\n"
@@ -505,7 +505,7 @@ static void MIX_AREAS_24_CMOV(unsigned int size,
"\tmovzwl (%%esi), %%ecx\n"
"\tmovl (%%ebx), %%edx\n"
"\tsall $16, %%eax\n"
- "\t" LOCK_PREFIX "btsl $0, (%%edi)\n"
+ "\t" LOCK_PREFIX "btsw $0, (%%edi)\n"
"\tleal (%%ecx,%%eax,1), %%ecx\n"
"\tjc 2f\n"
"\t" XSUB " %%edx, %%ecx\n"
diff --git a/src/pcm/pcm_dmix_x86_64.h b/src/pcm/pcm_dmix_x86_64.h
index 45627343..b4d0a412 100644
--- a/src/pcm/pcm_dmix_x86_64.h
+++ b/src/pcm/pcm_dmix_x86_64.h
@@ -287,7 +287,7 @@ static void MIX_AREAS_24(unsigned int size,
"\tmovswl (%%rsi), %%ecx\n"
"\tmovl (%%rbx), %%edx\n"
"\tsall $16, %%eax\n"
- "\t" LOCK_PREFIX "btsl $0, (%%rdi)\n"
+ "\t" LOCK_PREFIX "btsw $0, (%%rdi)\n"
"\t.byte 0x67, 0x8d, 0x0c, 0x01\n"
"\tjc 2f\n"
"\t" XSUB " %%edx, %%ecx\n"