Commit d8ab3468 authored by Josh Coalson's avatar Josh Coalson
Browse files

add some asserts

parent 4b974e7c
......@@ -487,6 +487,7 @@ FLAC__bool FLAC__metadata_simple_iterator_set_block(FLAC__Metadata_SimpleIterato
FLAC__ASSERT(0 != iterator);
FLAC__ASSERT(0 != iterator->file);
FLAC__ASSERT(0 != block);
if(!iterator->is_writable) {
iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE;
......@@ -587,6 +588,7 @@ FLAC__bool FLAC__metadata_simple_iterator_insert_block_after(FLAC__Metadata_Simp
FLAC__ASSERT(0 != iterator);
FLAC__ASSERT(0 != iterator->file);
FLAC__ASSERT(0 != block);
if(!iterator->is_writable)
return false;
......
......@@ -432,6 +432,9 @@ static FLAC__bool compare_block_data_vorbiscomment_(const FLAC__StreamMetadata_V
FLAC__bool FLAC__metadata_object_is_equal(const FLAC__StreamMetadata *block1, const FLAC__StreamMetadata *block2)
{
FLAC__ASSERT(0 != block1);
FLAC__ASSERT(0 != block2);
if(block1->type != block2->type) {
return false;
}
......@@ -458,15 +461,11 @@ FLAC__bool FLAC__metadata_object_is_equal(const FLAC__StreamMetadata *block1, co
}
}
/*@@@move
sets the application data to 'data'. if 'copy' is true, makes, copy, else takes ownership of pointer. returns false if copy==true and malloc fails.
FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_APPLICATION);
FLAC__ASSERT((0 != data && length > 0) || (0 == data && length == 0 && copy == false));
*/
FLAC__bool FLAC__metadata_object_application_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, unsigned length, FLAC__bool copy)
{
FLAC__byte *save;
FLAC__ASSERT(0 != object);
FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_APPLICATION);
FLAC__ASSERT((0 != data && length > 0) || (0 == data && length == 0 && copy == false));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment