metadata_iterators.c : Set status when metadata itereator is not writable.
authorErik de Castro Lopo <erikd@mega-nerd.com>
Sat, 15 Nov 2014 07:35:37 +0000 (23:35 -0800)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Sat, 15 Nov 2014 07:35:45 +0000 (23:35 -0800)
The status should be FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT.

Closes: http://sourceforge.net/p/flac/patches/50/

src/libFLAC/metadata_iterators.c

index b0f6378..61709bd 100644 (file)
@@ -763,8 +763,10 @@ FLAC_API FLAC__bool FLAC__metadata_simple_iterator_insert_block_after(FLAC__Meta
        FLAC__ASSERT(0 != iterator->file);
        FLAC__ASSERT(0 != block);
 
-       if(!iterator->is_writable)
+       if(!iterator->is_writable) {
+               iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE;
                return false;
+       }
 
        if(block->type == FLAC__METADATA_TYPE_STREAMINFO) {
                iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT;