Cykooz / libheif-rs

Safe wrapper to libheif-sys for parsing heif/heic files
MIT License
34 stars 11 forks source link

Fix null error message: heif_writer should return heif_error with no-null message #18

Closed meowtec closed 11 months ago

meowtec commented 11 months ago

As mentioned in the comment: https://github.com/strukturag/libheif/blob/master/libheif/heif.h#L321-L322

struct heif_error
{
  ...
  // textual error message (is always defined, you do not have to check for NULL)
  const char* message;
};

And heif_context_write only check if writer_error.message exists:

if (!writer_error.message) {
  return heif_error{heif_error_Usage_error, heif_suberror_Null_pointer_argument, "heif_writer callback returned a null error text"};
}

https://github.com/strukturag/libheif/blob/master/libheif/heif.cc#L1953-L1955

Cykooz commented 11 months ago

Thank you.