summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThibaut Mattern <tmattern@users.sourceforge.net>2003-11-01 01:44:54 +0000
committerThibaut Mattern <tmattern@users.sourceforge.net>2003-11-01 01:44:54 +0000
commitffc2ff99f83a51a73d9ca54000350dfa1c46d997 (patch)
treea496f40d2226c1c1110b993c02f07a6146da11c6 /src
parentbfbddb073cc71f582241198f1565a31580210b20 (diff)
downloadxine-lib-ffc2ff99f83a51a73d9ca54000350dfa1c46d997.tar.gz
xine-lib-ffc2ff99f83a51a73d9ca54000350dfa1c46d997.tar.bz2
Fix a bug in ID3v2.2 parsing.
hadess: you can play your stream now. CVS patchset: 5660 CVS date: 2003/11/01 01:44:54
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_mpgaudio.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c
index 530704140..4ccc814d1 100644
--- a/src/demuxers/demux_mpgaudio.c
+++ b/src/demuxers/demux_mpgaudio.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: demux_mpgaudio.c,v 1.120 2003/10/30 00:49:07 tmattern Exp $
+ * $Id: demux_mpgaudio.c,v 1.121 2003/11/01 01:44:54 tmattern Exp $
*
* demultiplexer for mpeg audio (i.e. mp3) streams
*
@@ -642,17 +642,20 @@ static int id3v22_parse_tag(demux_mpgaudio_t *this, int8_t *mp3_frame_header) {
this->input->seek (this->input, tag_header.size - pos, SEEK_CUR);
} else {
- while ((pos + 6) < tag_header.size) {
+ while ((pos + 6) <= tag_header.size) {
if (id3v22_parse_frame_header(this->input, &tag_frame_header)) {
pos += 6;
if (tag_frame_header.id && tag_frame_header.size) {
- if ((pos + tag_frame_header.size) < tag_header.size) {
+ if ((pos + tag_frame_header.size) <= tag_header.size) {
if (!id3v22_interp_frame(this, &tag_frame_header)) {
- lprintf("invalid frame content\n");
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ "id2v22: invalid frame content\n");
}
} else {
- lprintf("invalid frame header\n");
- return 0;
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ "id3v22: invalid frame header\n");
+ this->input->seek (this->input, tag_header.size - pos, SEEK_CUR);
+ return 1;
}
pos += tag_frame_header.size;
} else {
@@ -661,14 +664,16 @@ static int id3v22_parse_tag(demux_mpgaudio_t *this, int8_t *mp3_frame_header) {
return 1;
}
} else {
- lprintf("id3v2_parse_frame_header problem\n");
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ "id2v22: id3v2_parse_frame_header problem\n");
return 0;
}
}
}
return 1;
} else {
- lprintf("id3v2_parse_header problem\n");
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ "id3v22: id3v2_parse_header problem\n");
return 0;
}
}