metadata_iterators.c : Set status when metadata itereator is not writable.

The status should be FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT.

Closes: http://sourceforge.net/p/flac/patches/50/
This commit is contained in:
Erik de Castro Lopo 2014-11-14 23:35:37 -08:00
parent cdff952fd8
commit 7efe8f3bb5

View 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;