Skip to content

Segmentation fault on .extract with some converted gif -> webp #3837

@lolistream

Description

@lolistream

Possible bug

Is this a possible bug in a feature of sharp, unrelated to installation?

  • Running npm install sharp completes without error.
  • Running node -e "require('sharp')" completes without error.

If you cannot confirm both of these, please open an installation issue instead.

Are you using the latest version of sharp?

  • I am using the latest version of sharp as reported by npm view sharp dist-tags.latest.

If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.

If you are using another package which depends on a version of sharp that is not the latest, please open an issue against that package instead.

What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?

System:
OS: Linux 6.5 Artix Linux
CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
Memory: 11.60 GB / 125.69 GB
Container: Yes
Shell: 5.2.15 - /bin/bash
Binaries:
Node: 21.0.0 - /usr/bin/node
npm: 10.2.1 - /usr/bin/npm
pnpm: 8.10.0 - /usr/bin/pnpm
npmPackages:
sharp: ^0.32.6 => 0.32.6

What are the steps to reproduce?

Convert animated .gif to animated .webp. Save and load into sharp again, then run .extract

What is the expected behaviour?

No segmentation fault

Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem

await sharp('test.gif', {
animated: true,
}).extract({left: 0, top: 0, width: 50, height: 50}).toBuffer(); // no segfault

await sharp('test.gif', {
animated: true,
}).webp().extract({left: 0, top: 0, width: 50, height: 50}).webp().toBuffer(); // no segfault

const buffer = await sharp('test.gif', {
animated: true,
}).webp().toBuffer();

await sharp(buffer, {animated: true}).extract({left: 0, top: 0, width: 50, height: 50}).toBuffer(); // segfault

Please provide sample image(s) that help explain this problem

test

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions