diff --git a/taglib/dsdiff/dsdifffile.cpp b/taglib/dsdiff/dsdifffile.cpp index 35f934cc..6a5cf843 100644 --- a/taglib/dsdiff/dsdifffile.cpp +++ b/taglib/dsdiff/dsdifffile.cpp @@ -226,7 +226,7 @@ bool DSDIFF::File::save(int tags, StripTags strip, ID3v2::Version version) // First: save ID3V2 chunk - ID3v2::Tag *id3v2Tag = ID3v2Tag(); + const ID3v2::Tag *id3v2Tag = ID3v2Tag(); if((tags & ID3v2) && id3v2Tag) { if(d->isID3InPropChunk) { @@ -255,7 +255,7 @@ bool DSDIFF::File::save(int tags, StripTags strip, ID3v2::Version version) // Second: save the DIIN chunk - DSDIFF::DIIN::Tag *diinTag = DIINTag(); + const DSDIFF::DIIN::Tag *diinTag = DIINTag(); if((tags & DIIN) && diinTag) { if(!diinTag->title().isEmpty()) { diff --git a/taglib/mp4/mp4properties.cpp b/taglib/mp4/mp4properties.cpp index 3f8d8d19..8fd398a4 100644 --- a/taglib/mp4/mp4properties.cpp +++ b/taglib/mp4/mp4properties.cpp @@ -138,7 +138,7 @@ MP4::Properties::read(File *file, Atoms *atoms) const MP4::AtomList trakList = moov->findall("trak"); for(const auto &track : trakList) { - MP4::Atom *hdlr = track->find("mdia", "hdlr"); + const MP4::Atom *hdlr = track->find("mdia", "hdlr"); if(!hdlr) { debug("MP4: Atom 'trak.mdia.hdlr' not found"); return; @@ -156,7 +156,7 @@ MP4::Properties::read(File *file, Atoms *atoms) return; } - MP4::Atom *mdhd = trak->find("mdia", "mdhd"); + const MP4::Atom *mdhd = trak->find("mdia", "mdhd"); if(!mdhd) { debug("MP4: Atom 'trak.mdia.mdhd' not found"); return; @@ -186,7 +186,7 @@ MP4::Properties::read(File *file, Atoms *atoms) } if(length == 0) { // No length found in the media header (mdhd), try the movie header (mvhd) - if(MP4::Atom *mvhd = moov->find("mvhd")) { + if(const MP4::Atom *mvhd = moov->find("mvhd")) { file->seek(mvhd->offset()); data = file->readBlock(mvhd->length()); if(data.size() >= 24 + 4) { diff --git a/taglib/mp4/mp4tag.cpp b/taglib/mp4/mp4tag.cpp index 85fa6527..42905574 100644 --- a/taglib/mp4/mp4tag.cpp +++ b/taglib/mp4/mp4tag.cpp @@ -65,7 +65,7 @@ MP4::Tag::Tag(TagLib::File *file, MP4::Atoms *atoms, d->file = file; d->atoms = atoms; - MP4::Atom *ilst = atoms->find("moov", "udta", "meta", "ilst"); + const MP4::Atom *ilst = atoms->find("moov", "udta", "meta", "ilst"); if(!ilst) { //debug("Atom moov.udta.meta.ilst not found."); return; @@ -268,7 +268,7 @@ MP4::Tag::saveExisting(ByteVector data, const AtomList &path) // check if there is an atom before 'ilst', and possibly use it as padding if(index != meta->children().cbegin()) { auto prevIndex = std::prev(index); - MP4::Atom *prev = *prevIndex; + const MP4::Atom *prev = *prevIndex; if(prev->name() == "free") { offset = prev->offset(); length += prev->length(); @@ -277,7 +277,7 @@ MP4::Tag::saveExisting(ByteVector data, const AtomList &path) // check if there is an atom after 'ilst', and possibly use it as padding auto nextIndex = std::next(index); if(nextIndex != meta->children().cend()) { - MP4::Atom *next = *nextIndex; + const MP4::Atom *next = *nextIndex; if(next->name() == "free") { length += next->length(); } diff --git a/taglib/tagunion.cpp b/taglib/tagunion.cpp index d866bdce..22a0215c 100644 --- a/taglib/tagunion.cpp +++ b/taglib/tagunion.cpp @@ -106,7 +106,7 @@ void TagUnion::set(int index, Tag *tag) PropertyMap TagUnion::properties() const { - auto it = std::find_if(d->tags.cbegin(), d->tags.cend(), [](Tag *t) { + auto it = std::find_if(d->tags.cbegin(), d->tags.cend(), [](const Tag *t) { return t && !t->isEmpty(); }); return it != d->tags.cend() ? (*it)->properties() : PropertyMap();