We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 307 - Crash when loading OGG files
Summary: Crash when loading OGG files
Status: RESOLVED DUPLICATE of bug 369
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: x86 Windows (XP)
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-24 00:08 UTC by Geoff Carlton
Modified: 2007-02-13 02:55 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geoff Carlton 2006-08-24 00:08:29 UTC
I've just found a memory crash bug that occurs with the latest SDL_mixer 1.2.7 on windows, when loading OGG files.  The bug is this:

load_ogg.c mallocs a buffer internally:
   *audio_buf = malloc(*audio_len)

mixer.c frees it via the SDL dll:
   SDL_FreeWAV(chunk->abuf)

This can cause a problem since memory is allocated in one dll and freed in another.  My solution was to hack around in mixer.c.  I added an "int owner" variable, set to 1 in the OGG switch case, and replaced the couple of SDL_FreeWAV calls with:
   if (owner) free(chunk->abuf) else SDL_FreeWAV(chunk->abuf)
Comment 1 Peter Mulholland 2006-10-03 09:07:30 UTC
I didn't get this bug, but I did recompile SDL.dll and SDL_mixer.dll with MSVC 2005, which my game also compiles with. Perhaps this compilers runtime handles this sort of issue.
Comment 2 Patrice Mandin 2006-12-27 15:40:05 UTC
Duplicate of bug 369?
http://bugzilla.libsdl.org/show_bug.cgi?id=369
Comment 3 Ryan C. Gordon 2007-02-13 02:55:23 UTC
Yes, this is a duplicate bug.

--ryan.



*** This bug has been marked as a duplicate of 369 ***