metadata_object.c: Remove un-needed asserts
authorErik de Castro Lopo <erikd@mega-nerd.com>
Sun, 10 Jul 2016 01:18:34 +0000 (11:18 +1000)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Sun, 10 Jul 2016 01:25:39 +0000 (11:25 +1000)
These asserts were being triggered by AFL (American Fuzzy Lop) and
serve seemingly no useful purpose. The are only enabled in debug builds
where they abort the program which is otherwise in a safe state.

Removing these asserts will potentially allow AFL to turn up other
problems elsewhere.

src/libFLAC/metadata_object.c

index 05ca6b3..660dbee 100644 (file)
@@ -73,8 +73,6 @@ static FLAC__bool copy_bytes_(FLAC__byte **to, const FLAC__byte *from, unsigned
                *to = x;
        }
        else {
                *to = x;
        }
        else {
-               FLAC__ASSERT(0 == from);
-               FLAC__ASSERT(bytes == 0);
                *to = 0;
        }
        return true;
                *to = 0;
        }
        return true;
@@ -567,11 +565,9 @@ FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_clone(const FLAC__StreamMet
                                        return 0;
                                }
                                if(object->data.vorbis_comment.num_comments == 0) {
                                        return 0;
                                }
                                if(object->data.vorbis_comment.num_comments == 0) {
-                                       FLAC__ASSERT(0 == object->data.vorbis_comment.comments);
                                        to->data.vorbis_comment.comments = 0;
                                }
                                else {
                                        to->data.vorbis_comment.comments = 0;
                                }
                                else {
-                                       FLAC__ASSERT(0 != object->data.vorbis_comment.comments);
                                        to->data.vorbis_comment.comments = vorbiscomment_entry_array_copy_(object->data.vorbis_comment.comments, object->data.vorbis_comment.num_comments);
                                        if(0 == to->data.vorbis_comment.comments) {
                                                to->data.vorbis_comment.num_comments = 0;
                                        to->data.vorbis_comment.comments = vorbiscomment_entry_array_copy_(object->data.vorbis_comment.comments, object->data.vorbis_comment.num_comments);
                                        if(0 == to->data.vorbis_comment.comments) {
                                                to->data.vorbis_comment.num_comments = 0;