You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: 1.2.11 Reported for operating system, platform: All, All
Comments on the original bug report:
On 2011-08-07 00:27:36 +0000, Joshua Beck wrote:
Created attachment 670
Patch that fixes some memory errors against current hg
cppcheck found these errors:
[load_flac.c:337]: (error) Memory leak: client_data
[music_cmd.c:177]: (error) Possible null pointer dereference: argv - otherwise it is redundant to check if argv is null at line 172
[mixer.c:1294]: (error) Memory leak: new_e
[mixer.c:654]: (error) Memory leak: wavecvt.buf
[playmus.c:73]: (error) fflush() called on input stream "stdin" may result in undefined behaviour
[playwave.c]: (information) Interrupted checking because of too many #ifdef configurations.
[music.c]: (information) Interrupted checking because of too many #ifdef configurations.
[timidity/readmidi.c:115]: (error) Dereferencing 's' after it is deallocated / released
I fixed the ones in mixer.c and timidity/readmidi.c. The others I didn't know if they were false positives or not.
On 2011-08-24 23:21:45 +0000, Ryan C. Gordon wrote:
This is now hg changeset 563dbb082a17, thanks!
--ryan.
On 2011-09-10 23:05:35 +0000, Lee wrote:
With this patch (in particular the change to mixer.c:654) I'm getting a segfault sometimes and when calling Mix_FreeChunk a crash in 'free'.
This is because wavecvt.buf is actually assigned to chunk->abuf and is supposed to be freed when Mix_FreeChunk is called. So when something tries to play the audio it accesses the freed memory (which can cause a segfault or random sounds), and when Mix_FreeChunk tries to free chunk->abuf it was already freed in Mix_LoadWav.
On 2011-09-14 09:24:09 +0000, Ryan C. Gordon wrote:
(In reply to comment # 2)
This is because wavecvt.buf is actually assigned to chunk->abuf and is supposed
to be freed when Mix_FreeChunk is called. So when something tries to play the
audio it accesses the freed memory (which can cause a segfault or random
sounds), and when Mix_FreeChunk tries to free chunk->abuf it was already freed
in Mix_LoadWav.
Whoops, you're right. I've fixed this in hg changeset 675a11e697c6.
Thanks!
--ryan.
The text was updated successfully, but these errors were encountered:
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: 1.2.11
Reported for operating system, platform: All, All
Comments on the original bug report:
On 2011-08-07 00:27:36 +0000, Joshua Beck wrote:
On 2011-08-24 23:21:45 +0000, Ryan C. Gordon wrote:
On 2011-09-10 23:05:35 +0000, Lee wrote:
On 2011-09-14 09:24:09 +0000, Ryan C. Gordon wrote:
The text was updated successfully, but these errors were encountered: