From 8b0a0fb369da3da8563b96fc48dd028097b6688b Mon Sep 17 00:00:00 2001 From: CleverMouse Date: Fri, 27 Feb 2015 15:25:40 +0000 Subject: [PATCH] ac97snd: fix processing of >64K ID3 tags git-svn-id: svn://kolibrios.org@5485 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/media/ac97snd/ac97snd/ac97wav.c | 5 +++-- programs/media/ac97snd/mpg/readers.c | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/programs/media/ac97snd/ac97snd/ac97wav.c b/programs/media/ac97snd/ac97snd/ac97wav.c index 6bd49cf63e..ba50893074 100644 --- a/programs/media/ac97snd/ac97snd/ac97wav.c +++ b/programs/media/ac97snd/ac97snd/ac97wav.c @@ -761,9 +761,10 @@ DWORD test_m3u(char *buf) //Asper+ DWORD test_mp3(char *buf) { unsigned long hdr; WAVEHEADER whdr; + int attempts = 0; - while (1) - { if(rd.filepos > 102400) + for (;;attempts++) + { if(attempts > 1000) return 0; if(!rd.head_read(&rd,&hdr)) return 0; diff --git a/programs/media/ac97snd/mpg/readers.c b/programs/media/ac97snd/mpg/readers.c index 711a6d939b..798421defe 100644 --- a/programs/media/ac97snd/mpg/readers.c +++ b/programs/media/ac97snd/mpg/readers.c @@ -949,9 +949,17 @@ int parse_new_id3(struct reader *rd, unsigned long header) return -1; + if(rd->strremain < length) + { + rd->filepos += length - rd->strremain; + rd->strremain = 0; + } + else + { rd->strpos+=length; rd->stream+=length; rd->strremain-=length; + } #if 0 /* skip if unknown version/scary flags, parse otherwise */