Skip to content

Commit

Permalink
Fix nonsense loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeugma440 committed Aug 31, 2024
1 parent 980b2c6 commit cfaa8b5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ATL/AudioData/IO/AA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,12 @@ protected override int write(TagData tag, Stream s, string zone)
}
if (zone.Equals(ZONE_IMAGE))
{
result = 0;
foreach (PictureInfo picInfo in tag.Pictures.Where(isPictureWritable))
{
writePictureFrame(s, picInfo.PictureData);
return 1; // Stop here; there can only be one picture in an AA file
}
// There can only be one picture in an AA file
var writablePic = tag.Pictures.FirstOrDefault(isPictureWritable);
if (null == writablePic) return 0;

writePictureFrame(s, writablePic.PictureData);
result = 1;
}

return result;
Expand Down

0 comments on commit cfaa8b5

Please sign in to comment.