Skip to content
Permalink
Browse files Browse the repository at this point in the history
Don't assume TDRC is an instance of TextIdentificationFrame (#831)
If TDRC is encrypted, FrameFactory::createFrame() returns UnknownFrame
which causes problems in rebuildAggregateFrames() when it is assumed
that TDRC is a TextIdentificationFrame
  • Loading branch information
sbooth committed Sep 30, 2017
1 parent 0b583ba commit cb9f07d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions taglib/mpeg/id3v2/id3v2framefactory.cpp
Expand Up @@ -334,10 +334,11 @@ void FrameFactory::rebuildAggregateFrames(ID3v2::Tag *tag) const
tag->frameList("TDAT").size() == 1)
{
TextIdentificationFrame *tdrc =
static_cast<TextIdentificationFrame *>(tag->frameList("TDRC").front());
dynamic_cast<TextIdentificationFrame *>(tag->frameList("TDRC").front());
UnknownFrame *tdat = static_cast<UnknownFrame *>(tag->frameList("TDAT").front());

if(tdrc->fieldList().size() == 1 &&
if(tdrc &&
tdrc->fieldList().size() == 1 &&
tdrc->fieldList().front().size() == 4 &&
tdat->data().size() >= 5)
{
Expand Down

0 comments on commit cb9f07d

Please sign in to comment.