Skip to content

Commit

Permalink
Use a buffer to read picture data [#266]
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeugma440 committed May 30, 2024
1 parent 2a4dc9e commit 2a4a336
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ATL/AudioData/IO/ID3v2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,9 @@ private static LyricsInfo.LyricsPhrase readLyricsPhrase(BufferedBinaryReader sou
}
else
{
data = new byte[picSize];
source.Read(data, 0, picSize);
using MemoryStream outStream = new MemoryStream(picSize);
StreamUtils.CopyStream(source, outStream, picSize);
data = outStream.ToArray();
}
PictureInfo picInfo = PictureInfo.fromBinaryData(data, picType, getImplementedTagType(), picCode, picturePosition);
picInfo.Description = description;
Expand Down

0 comments on commit 2a4a336

Please sign in to comment.