libheif
libheif copied to clipboard
heif_context_read_from_reader bug?
I've got a HEIC image that will not load using LibHeifSharp. However, if I bind to libheif directly, i can get it to work.
Looking into the source, it appears that LibHeifSharp bindings only use the heif_context_read_from_reader method to load the content. If i use heif_context_read_from_file or heif_context_read_from_memory, it works just fine.
Specifically, when using heif_context_read_from_reader, the library aborts due to an assertion failure inside read_data of box.cc
I assume this is a bug within libheif and not a bug in LibHeifSharp. Let me know if you'd like a sample HEIC image.
Both heif_context_read_from_file
and heif_context_read_from_memory
internally read from a reader object:
https://github.com/strukturag/libheif/blob/d2b412553346c8cb057a9fe8a966a2471e732474/libheif/heif_file.cc#L80
https://github.com/strukturag/libheif/blob/d2b412553346c8cb057a9fe8a966a2471e732474/libheif/heif_file.cc#L87
Could you provide the full stack trace, ideally with variables? If reading with libheif works, it's probably a problem with the LibHeifSharp binding.
I fixed a bug in the LibHeifSharp callback for heif_reader->read
in version 2.2.0.
Requests to read zero bytes were failing due to incorrect parameter validation.
Is anything more required on this?
No, it can be closed.