check the return when constructing comment entries#12
Conversation
The `FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair` function call can fail which will lead to `FLAC__metadata_object_vorbiscomment_append_comment` segfaulting or producing invalid results. I have observed this to happen after 2 days of normal playback. It is reproducible much more readily if I just skip a lot. With this fix in place, even with skipping I haven’t been able to reproduce the crash again.
|
Thank you for this! I think I'd rather have the encoder raise an exception to let the user know that they are submitting invalid metadata. Otherwise, it might be surprising to think everything went fine while some metadata is missing. Let me know if you're confortable doing that in the ocaml C code (declare new exception on the ML side, register it for C callback, call it in the C code). Otherwise, I'm happy to do it. The reference for OCaml bindings is here: https://v2.ocaml.org/manual/intfc.html |
Hm, with this being a part of context creation, I wonder how would something like
Please take over. An unfortunate thing with |
I'll think about it from the
Sounds good. Looks like the errors are either one of the two above or a |
The
FLAC__metadata_object_vorbiscomment_entry_from_name_value_pairfunction call can fail which will lead to
FLAC__metadata_object_vorbiscomment_append_commentsegfaulting orproducing invalid results. I have observed this to happen after 2 days
of normal playback. It is reproducible much more readily if I just skip
a lot.
With this fix in place, even with skipping I haven’t been able to
reproduce the crash again.