]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Fix segfault with dmix of 3-bytes formats
authorJosh Green <josh@resonance.org>
Sat, 7 Jun 2008 08:10:49 +0000 (10:10 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sat, 7 Jun 2008 08:10:49 +0000 (10:10 +0200)
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>
src/pcm/pcm_dmix_i386.h
src/pcm/pcm_dmix_x86_64.h

index 1ae037ae0674b2f631eb261ce225f862ae570cac..9ea155d9c245ac6b2c64fa8a88d613ea5e6f8a6e 100644 (file)
@@ -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"
index 4562734339f473639ad2f5079f3b4f398162ff6a..b4d0a412db6393df795be4eb64c0747b32a75482 100644 (file)
@@ -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"