Skip to content

Commit

Permalink
fixed: mp4 tag infinate loop on damaged files (properly this time)
Browse files Browse the repository at this point in the history
(cherry picked from commit bdea3df2f089f406cf0c2a0b56e76973c8fd291e)

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@33237 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information
jmarshallnz committed Aug 28, 2010
1 parent 75db083 commit 8a1bbd6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions xbmc/MusicInfoTagLoaderMP4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,15 @@ int CMusicInfoTagLoaderMP4::ParseAtom( int64_t startOffset, int64_t stopOffset,
unsigned int metaKey = ReadUnsignedInt( atomBuffer.get() + nextTagPosition );
char* metaData = ( atomBuffer.get() + nextTagPosition ) + 20;

if (metaSize - 20 <= 0)
break;

// This is where the next chunk of data will be, if present..
nextTagPosition += ( metaSize + 4 );


// Ok.. we've got some metadata to process. Go to it.
if (metaSize - 20 > 0)
ParseTag( metaKey, metaData, metaSize - 20, tag );
ParseTag( metaKey, metaData, metaSize - 20, tag );
}
}
else
Expand Down

0 comments on commit 8a1bbd6

Please sign in to comment.