strukturag / libheif

libheif is an HEIF and AVIF file format decoder and encoder.
Other
1.76k stars 304 forks source link

Replace low-level file access and HEIF file parsing #1242

Closed farindk closed 2 months ago

farindk commented 4 months ago

This is a major rework of how libheif parses input files and handles reading and writing especially large files. The goal is to

farindk commented 2 months ago

Not finished, but progressed far enough that I decided to merge it into 'master'.

kleisauke commented 2 months ago

The libvips fuzzers detected a crash in this implementation that didn't occur on v1.18.2.

$ build-v1.18.2/examples/heif-dec crash-a88cb4551382b7015408ee76bc731e2e99188db6
File contains 2 images
Could not decode image: 0: Invalid input: Unspecified: Corrupt frame detected
$ build-master/examples/heif-dec crash-a88cb4551382b7015408ee76bc731e2e99188db6
terminate called after throwing an instance of 'std::length_error'
  what():  vector::_M_default_append
Aborted (core dumped)

Is it too early to report bugs found by fuzzers? I could share the file privately or publicly, whichever you prefer.

farindk commented 2 months ago

@kleisauke Would be great if you could share the file. Just attaching it here would be fine I think.

kleisauke commented 2 months ago

Great! You can find the file here: crash-a88cb4551382b7015408ee76bc731e2e99188db6.zip (zipped due to GitHub's upload restrictions)

farindk commented 2 months ago

@kleisauke Thanks. The out-of-memory crash should be fixed now.