Skip to content

Commit

Permalink
avoid freezes reading incomplete mp3 files
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Shaforostov committed Mar 2, 2018
1 parent a800931 commit 0502695
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions taglib/mpeg/mpegfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,9 @@ long MPEG::File::lastFrameOffset()
else
position = length();

if (position >= length()) //if the file is incomplete
position = 0xfffff; //some small value

return previousFrameOffset(position);
}

Expand Down

0 comments on commit 0502695

Please sign in to comment.