[flac-dev] about libFLAC/metadata_object.c

lvqcl lvqcl.mail at gmail.com
Sun Jun 28 08:01:04 PDT 2015

There are two functions:

     static void vorbiscomment_entry_array_delete_(FLAC__StreamMetadata_VorbisComment_Entry *object_array, unsigned num_comments);


     static void cuesheet_track_array_delete_(FLAC__StreamMetadata_CueSheet_Track *object_array, unsigned num_tracks);

which first dereference object_array and only then check it for NULL:

         if(0 != object_array)

Currently the condition "if(0 != object_array)" is not necessary because libFLAC
always checks the first argument of these static functions before calling them.

Also the check was added in the commit "fix null pointer handling in metadata object routines":
The function wasn't static back then.

So it make sense either to remove this unnecessary check or to make it much earlier,
before dereferencing.

More information about the flac-dev mailing list