Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#1067 closed defect (fixed)

MP3: ScummVM reads past end of file

Reported by: Kirben Owned by: fingolfin
Priority: normal Component: Engine: SCUMM
Keywords: Cc:
Game: Monkey Island 1

Description

Latest ScummVM cvs version.
English version of Monkey Island 1 (CD)
Compiled under mingw with GCC 3.2.3 and running under
Windows XP.
Using mp3s for music.

ScummVM often reports 'Error decoding after restream
1 !' after playing a music track and seems to be reading
past the end of the files. The easiest point to spot it is
at the part one screen just at it ends.

Ticket imported from: #776169. Ticket imported from: bugs/1067.

Change History (5)

comment:1 by fingolfin, 16 years ago

Can't reproduce this problem. But the most likely cause is that
ChannelMP3CDMusic::mix() doesn't check the return value of
File::read. It should check for negative (or 0) values, and act
appropriately when it sees them. Not sure what exactly would be
"appropriate", maybe just destroy() the channel and return. I.e.
insert this:

if (_size <= 0) {
destroy();
return;
}
BTW, farther up there is similiar code, but it reads "if(!_size)" -
that's not sufficient.
Can you try if these changes help you?

comment:2 by Kirben, 16 years ago

That change didn't seem to help, although I'm not sure if I
added it in right places. I placed it after each _size = _file-
>read....

Could this be related to the mp3 problem that valgrind
reported of an 'invlaid read of size 1' in simon with mp3s
awhile ago ?

comment:3 by fingolfin, 16 years ago

Actually, it fixes it for me... I put a change into CVS which fixes
the problem for me, can you check if it's gone for you, or not?

comment:4 by Kirben, 16 years ago

I put that size check in the wrong spot before, the problem
no longer occurs with ScummVM 0.5.3-cvs.

comment:5 by Kirben, 16 years ago

Owner: set to fingolfin
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.