Skip to content

Commit

Permalink
fix: bad alignment calculation
Browse files Browse the repository at this point in the history
Another attempt at fixing #26. Still no automatic reproducer test script
unfortunately. Closes #38 (thanks @tc-hib once more!)
  • Loading branch information
akavel committed Mar 12, 2021
1 parent 67980f0 commit 48a25be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion coff/coff.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func (coff *Coff) AddResource(kind uint32, id uint16, data Sizer) {
func pad(data Sizer) PaddedData {
return PaddedData{
Data: data,
Padding: make([]byte, (data.Size()+7)&^7),
Padding: make([]byte, -data.Size()&7),
}
}

Expand Down
3 changes: 3 additions & 0 deletions rsrc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func TestBuildSucceeds(t *testing.T) {
}{{
comment: "icon",
args: []string{"-ico", "akavel.ico"},
}, {
comment: "unaligned icon (?) - issue #26",
args: []string{"-ico", "syncthing.ico"},
}, {
comment: "manifest",
args: []string{"-manifest", "manifest.xml"},
Expand Down
Binary file added testdata/syncthing.ico
Binary file not shown.

0 comments on commit 48a25be

Please sign in to comment.