From 4684608fb19cab1ebf9e6ce443e0771378d52e58 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sat, 16 Jan 2016 07:57:26 +1100 Subject: [PATCH] metadata_iterators.c: Add missing check for is_writable Patch-from: lvqcl --- src/libFLAC/metadata_iterators.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libFLAC/metadata_iterators.c b/src/libFLAC/metadata_iterators.c index 45278789..4fd58c8c 100644 --- a/src/libFLAC/metadata_iterators.c +++ b/src/libFLAC/metadata_iterators.c @@ -837,6 +837,11 @@ FLAC_API FLAC__bool FLAC__metadata_simple_iterator_delete_block(FLAC__Metadata_S FLAC__ASSERT_DECLARATION(FLAC__off_t debug_target_offset = iterator->offset[iterator->depth];) FLAC__bool ret; + if(!iterator->is_writable) { + iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE; + return false; + } + if(iterator->type == FLAC__METADATA_TYPE_STREAMINFO) { iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT; return false;