Skip to content

Commit

Permalink
update libwebp to 1.3.2
Browse files Browse the repository at this point in the history
This addresses CVE-2023-4863.

Additionally, Linux aarch64 and macOS arm64 binaries are added. Linux
x86 is removed as previously this was an x64 binaries; prebuilt x86
Linux binaries are no longer distributed.

The source and binaries are from:
  https://developers.google.com/speed/webp/download

Fixes: imagemin#62
  • Loading branch information
jzern committed Oct 13, 2023
1 parent 91dfc00 commit 579f868
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.ur
const url = `https://raw.githubusercontent.com/imagemin/cwebp-bin/v${pkg.version}/vendor/`;

const binWrapper = new BinWrapper()
.src(`${url}osx/cwebp`, 'darwin')
.src(`${url}linux/x86/cwebp`, 'linux', 'x86')
.src(`${url}osx/arm64/cwebp`, 'darwin', 'arm64')
.src(`${url}osx/x86-64/cwebp`, 'darwin', 'x86-64')
.src(`${url}linux/aarch64/cwebp`, 'linux', 'aarch64')
.src(`${url}linux/x64/cwebp`, 'linux', 'x64')
.src(`${url}win/x64/cwebp.exe`, 'win32', 'x64')
.dest(fileURLToPath(new URL('../vendor', import.meta.url)))
Expand Down
2 changes: 1 addition & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bin.run(['-version']).then(() => {
console.info('compiling from source');

try {
const source = fileURLToPath(new URL('../vendor/source/libwebp-1.2.1.tar.gz', import.meta.url));
const source = fileURLToPath(new URL('../vendor/source/libwebp-1.3.2.tar.gz', import.meta.url));

binBuild.file(source, [
`./configure --disable-shared --prefix="${bin.dest()}" --bindir="${bin.dest()}"`,
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test('rebuild the cwebp binaries', async t => {
}

const temporary = temporaryDirectory();
const source = fileURLToPath(new URL('../vendor/source/libwebp-1.2.1.tar.gz', import.meta.url));
const source = fileURLToPath(new URL('../vendor/source/libwebp-1.3.2.tar.gz', import.meta.url));

await binBuild.file(source, [
`./configure --disable-shared --prefix="${temporary}" --bindir="${temporary}"`,
Expand Down
Binary file added vendor/linux/aarch64/cwebp
Binary file not shown.
Binary file modified vendor/linux/x64/cwebp
Binary file not shown.
Binary file removed vendor/linux/x86/cwebp
Binary file not shown.
Binary file added vendor/osx/arm64/cwebp
Binary file not shown.
Binary file removed vendor/osx/cwebp
Binary file not shown.
Binary file added vendor/osx/x86-64/cwebp
Binary file not shown.
Binary file not shown.
Binary file modified vendor/win/x64/cwebp.exe
Binary file not shown.

0 comments on commit 579f868

Please sign in to comment.