diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-01-25 09:34:08 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-01-25 09:34:08 -0800 |
commit | dbbff6e3ff4ce7e2c1fd84b42559c312656c2d69 (patch) | |
tree | 49c8f68653410d06feea68fea21ac67b2dd0c738 | |
parent | 85a05b3d45b83a23510841ea02fd2ebb38bc12ab (diff) | |
download | syslinux.git-dbbff6e3ff4ce7e2c1fd84b42559c312656c2d69.tar.gz syslinux.git-dbbff6e3ff4ce7e2c1fd84b42559c312656c2d69.tar.xz syslinux.git-dbbff6e3ff4ce7e2c1fd84b42559c312656c2d69.zip |
ldlinux: fix FAT EOF detection
We had the wrong highest possible cluster for the FAT; adjust it so
that it matches the definition.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | core/ldlinux.asm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/ldlinux.asm b/core/ldlinux.asm index ba7e8040..70f9c715 100644 --- a/core/ldlinux.asm +++ b/core/ldlinux.asm @@ -1242,7 +1242,8 @@ nextcluster_fat12: shr cx,4 .even: and cx,0FFFh movzx edi,cx - cmp di,0FF0h + lea ax,[di-2] + cmp ax,0FF5h pop si pop cx pop bx @@ -1264,7 +1265,8 @@ nextcluster_fat16: add bx,bx and bx,1FEh movzx edi,word [gs:si+bx] - cmp di,0FFF0h + lea ax,[di-2] + cmp ax,0FFF5h pop bx pop si pop eax @@ -1285,7 +1287,8 @@ nextcluster_fat28: and bx,1FCh mov edi,dword [gs:si+bx] and edi,0FFFFFFFh ; 28 bits only - cmp edi,0FFFFFF0h + lea eax,[edi-2] + cmp eax,0FFFFFF5h pop bx pop si pop eax |