-
-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
poc of HEIC crash #784
Comments
Thanks, but I could not reproduce this. Even with older versions of libheif and libde265. |
@farindk I'm seeing the crash with old and new libraries. Tested: OS: Ubuntu 20.04.5 LTS Compiling method: libde265: x265_git: libheif: I haven't tried a stack trace yet. |
Oh interesting... libheif/examples/ heif-info, heif-convert both work (no crash). Looks like the problem may be in how my code is calling the library. (Diving deeper.) |
Oh, I found the problem. I'm not seeing any decode errors. Shouldn't there be something that denotes a truncated image? |
In my opinion, the My advice would be to completely ignore the I'm cross linking this to the related #773. |
Without ispe, how do you recommend/propose tools like ExifTool identify the image size without rendering the image? |
As far as I can tell, if there are any transforms beyond a simple crop, you basically have to run the entire compositing engine anyway to obtain the final canvas size, even if you don't perform the pixel manipulation part of it. |
@hackerfactor can I take this |
@bigcat88 The corrupt image isn't mine, so I cannot give permission. It was an upload to FotoForensics.com. The ToS at FotoForensics says that all images can be used for research. As long as your test suite is research-only and private/personal (not distributed, not sold), then that's fine. But if it's part of an open source set, then that's a no. |
@silverbacknet wrote:
That's disappointing. Especially given the time and resources needed to decode a HEIC file. That's a lot of overhead to just find out the dimensions. |
It's all calculable from the metadata alone, so the full thing doesn't have to be parsed. If there are no derived images, then just start at the ispe box, and keep walking, recalculating w & h for every transformative box you encounter. The only ones that would really affect it are clap (crop), irot (rotation), and iscl (scaling). I was thinking about overlays too, but I forgot that's derived only. If there are derived images (tiled or overlaid) then those will have the actual final size in their structs. If there are multiple base or derived images, you have to pick which you want to show, then. |
I disagree. See also #555 |
That's the problem. In the crash poc file, the ispe does not match the decoded image dimensions. |
in the python bindings i made the decision to mark such files as corrupted (when Edited(19 March): it was a bad idea, some cameras store in |
Just curious: Is this image satisfy HEIF standard? |
The ispe matches the image dimensions before transformations (rotation). |
This kind of misses the point of descriptive item properties. The point of the descriptive item properties is to allow a parser to quickly determine basic properties about a file without actually having to call into specific codecs. All transform properties and derived items tell you what the output is, assuming you know the input. So as long as you know the input, you can fully reason about all existing properties and item types. But for a coded item you would have to call into a codec to get information about the input. This is problematic for multiple reasons:
Because of this it was decided that all image items shall have an At decode time the HEIF parser will need to validate that the output of the decoder matches the |
Admittedly it would have been nice if all images had to end up in with an auxC box, even if composed of just one source image with no transforms. That would simplify parsing even more, just look for the auxC (or identical clone for the master image), and it would also be useful as yet another check for validity across the entire chain. |
|
A user just uploaded to my site a file called "poc.heic" that causes libheif to crash.
The HEIC file structure is valid. The error is coming from somewhere deeper.
The HEIC file contains 4 images. Primary, thumb1, and thumb2 will crash. Thumb3 renders as really corrupted.
I have temporarily placed the file at https://hackerfactor.com/private/poc-heic.zip. The zip contains poc.heic.
The text was updated successfully, but these errors were encountered: