XiphComment has removePicture() and it is used for OGG formats such as vorbis ogg or flac ogg.
When try to remove picture on those files we can use this method.
but when remove it with reference from the Picture_list[index], like a FLAC file, crash occurred.
(actually crash not occurred in this method, but after removing, if we try to access (eg. by using save() or getting picture)
the picture list which has more than 1 picture, crash occurred)
I don't know the reason why.
So anyway, modified it to use iterator.
Change-Id: I0dae724860ca3efab42d5e981b7f3fc5adf1d954
ret = __is_valid_picture_index(lst.isEmpty(), lst.size(), index);
metadata_editor_retvm_if(ret != METADATA_EDITOR_ERROR_NONE, ret, "Invalid picture index");
- xtag->removePicture(lst[index], false);
+ TagLib::List<TagLib::FLAC::Picture*>::Iterator it = lst.begin();
+ std::advance(it, index);
+ xtag->removePicture(*it, true);
return METADATA_EDITOR_ERROR_NONE;
}