Skip to content

Commit

Permalink
audtag: read only first valid PIC/APIC frame. Closes: #1220
Browse files Browse the repository at this point in the history
  • Loading branch information
jlindgren90 committed Oct 21, 2023
1 parent e995c3c commit b842455
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/libaudtag/id3/id3v22.cc
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ bool ID3v22TagModule::read_tag (VFSFile & handle, Tuple & tuple, Index<char> * i
id3_decode_rva (tuple, & frame[0], frame.len ());
break;
case ID3_PIC:
if (image)
/* we can return only one image, so once we have found a
* valid one, don't read any more PIC frames */
if (image && !image->len())
* image = id3_decode_pic (& frame[0], frame.len ());
break;
case ID3_LYRICS:
Expand Down
4 changes: 3 additions & 1 deletion src/libaudtag/id3/id3v24.cc
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,9 @@ bool ID3v24TagModule::read_tag (VFSFile & handle, Tuple & tuple, Index<char> * i
rva_frames.append (std::move (frame));
break;
case ID3_APIC:
if (image)
/* we can return only one image, so once we have found a
* valid one, don't read any more APIC frames */
if (image && !image->len())
* image = id3_decode_apic (& frame[0], frame.len ());
break;
case ID3_LYRICS:
Expand Down

0 comments on commit b842455

Please sign in to comment.