From: Elia Cereda Date: Sat, 30 Jun 2012 14:25:33 +0000 (+0200) Subject: Fixed error "Branch condition evaluates to a garbage value" (from Xcode 4.3.3 Static... X-Git-Tag: v1.8beta~9^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c68fe9ad7b43cf18186855107a7f53c534d08a27;p=taglib Fixed error "Branch condition evaluates to a garbage value" (from Xcode 4.3.3 Static Analyzer, mpeg/id3v2/id3v2tag.cpp:377) This error occurs when the frame variable is left uninitialized because its id doesn't match any of the ids in the if and else-id cases. Initializing it on declaration fixes this issue. --- diff --git a/taglib/mpeg/id3v2/id3v2tag.cpp b/taglib/mpeg/id3v2/id3v2tag.cpp index ce228330..c6fe7b74 100644 --- a/taglib/mpeg/id3v2/id3v2tag.cpp +++ b/taglib/mpeg/id3v2/id3v2tag.cpp @@ -365,7 +365,7 @@ void ID3v2::Tag::removeUnsupportedProperties(const StringList &properties) if(it->size() <= 5) continue; // invalid specification String description = it->substr(5); - Frame *frame; + Frame *frame = NULL; if(id == "TXXX") frame = UserTextIdentificationFrame::find(this, description); else if(id == "WXXX")