id3v2: fix handling of tags with extended headers

The extended header size value does not include itself.

https://bugzilla.gnome.org/show_bug.cgi?id=770355
This commit is contained in:
Thomas Bluemel 2016-08-24 10:33:14 -06:00 committed by Tim-Philipp Müller
parent cd4253028e
commit da6070054f

View file

@ -448,7 +448,7 @@ id3v2_frames_to_tag_list (ID3TagsWorking * work, guint size)
if (work->hdr.flags & ID3V2_HDR_FLAG_EXTHDR) {
work->hdr.ext_hdr_size = id3v2_read_synch_uint (work->hdr.frame_data, 4);
if (work->hdr.ext_hdr_size < 6 ||
(work->hdr.ext_hdr_size) > work->hdr.frame_data_size) {
(work->hdr.ext_hdr_size + 4) > work->hdr.frame_data_size) {
GST_DEBUG ("Invalid extended header. Broken tag");
return FALSE;
}
@ -460,8 +460,8 @@ id3v2_frames_to_tag_list (ID3TagsWorking * work, guint size)
}
work->hdr.ext_flag_data = work->hdr.frame_data + 5;
work->hdr.frame_data += work->hdr.ext_hdr_size;
work->hdr.frame_data_size -= work->hdr.ext_hdr_size;
work->hdr.frame_data += work->hdr.ext_hdr_size + 4;
work->hdr.frame_data_size -= work->hdr.ext_hdr_size + 4;
}
frame_hdr_size = id3v2_frame_hdr_size (work->hdr.version);