Opened 20 years ago

Closed 20 years ago

Last modified 6 years ago

#1755 closed defect (fixed)

Memory leak in vorbis.cpp?

Reported by: eriktorbjorn Owned by: fingolfin
Priority: normal Component: Audio
Version: Keywords:
Cc: Game:


It looks like vorbis.cpp is leaking memory. I got this warning when exiting a game that used an Ogg Vorbis-encoded MONSTER.SOU, using a September 3 CVS ScummVM snapshot:

==27583== 2112 bytes in 3 blocks are definitely lost in loss record 121 of 140 ==27583== at 0x3414A753: operator new(unsigned) (vg_replace_malloc.c:133) ==27583== by 0x81C1233: makeVorbisStream(File*, unsigned) (vorbis.cpp:328) ==27583== by 0x80681EA: Scumm::Sound::startSfxSound(File*, int, PlayingSoundHandle*, int) (sound.cpp:981) ==27583== by 0x8067A2A: Scumm::Sound::startTalkSound(unsigned, unsigned, int, PlayingSoundHandle*) (sound.cpp:709)

It's not unique to MONSTER.SOU, though - I got the same message when I tested my not-yet-committed support for compressed music in Broken Sword II. It looks like it's leaking one block of memory for each Vorbis stream that's created. I think it's the OggVorbis_File object that makeVorbisStream() allocates, but I don't know if it's enough to simply "delete _ov_file" in the VorbisInputStream destructor, or if that'll break something else. Valgrind debugging is too depressingly slow on my computer to do any extensive testing of unfamiliar code.

Ticket imported from: #1022265. Ticket imported from: bugs/1755.

Change History (2)

comment:1 by fingolfin, 20 years ago

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:2 by digitall, 6 years ago

Component: --Unset--Audio
Note: See TracTickets for help on using tickets.