diff --git a/src/libaudtag/id3/id3v22.cc b/src/libaudtag/id3/id3v22.cc index bb03033ce..b38550a83 100644 --- a/src/libaudtag/id3/id3v22.cc +++ b/src/libaudtag/id3/id3v22.cc @@ -286,7 +286,9 @@ bool ID3v22TagModule::read_tag (VFSFile & handle, Tuple & tuple, Index * 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: diff --git a/src/libaudtag/id3/id3v24.cc b/src/libaudtag/id3/id3v24.cc index e299b830b..6083ce96e 100644 --- a/src/libaudtag/id3/id3v24.cc +++ b/src/libaudtag/id3/id3v24.cc @@ -648,7 +648,9 @@ bool ID3v24TagModule::read_tag (VFSFile & handle, Tuple & tuple, Index * 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: