Closed wrist closed 2 years ago
Thanks for your PR.😆 I'm sorry that I was a bit busy recently and have not noticed this. I will review it within the next day.
And one more thing, I will likely not be able to squeeze out much free time for a long time. Do you mind if I transfer the ownership of this project to you? Don't worry if you have no interest in it.
According to this, the function
sf_get_string
returnsNULL
if the result string doesn't exist for givenTagType
. Soget_tag
function usingsf_get_string
has a possibility to cause a segmentation fault due to theNULL
for sound files such as.wav
whose a valid tag doesn't exist in their metadata. This segmentation fault happens at the below line. https://github.com/Xeiron/sndfile.rs/blob/33219f56cf52ac261468f5d8a82ed25718ed9076/src/lib.rs#L746I think it's better to use
s_ptr.as_ref()
instead ofs_ptr
directly like the below code.I also think
get_tag
may returnOption<String>
to express the casesf_get_string
fails. How about this?