| Summary: | native_midi_win32.c pointer truncation in midiStreamOpen call | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | Steven Noonan <steven> |
| Component: | misc | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | 1.2.8 | ||
| Hardware: | x86 | ||
| OS: | Windows (All) | ||
| Attachments: | DWORD_PTR patch for native_midi_win32 | ||
|
Description
Steven Noonan
2008-05-13 13:31:36 UTC
I would normally attach the patch, but I'm getting Bugzilla internal errors when trying to upload it: Internal Error Bugzilla has suffered an internal error. Please save this page and send it to bugmaster@icculus.org with details of what you were doing at the time this message appeared. URL: http://bugzilla.libsdl.org/attachment.cgi undef error - Undefined subroutine Fh::slice at data/template/template/en/default/global/hidden-fields.html.tmpl line 58 So, here's the patch text: --- SDL_mixer-1.2.8-1/native_midi/native_midi_win32.c 2008-05-13 13:24:56.287800000 -0700 +++ SDL_mixer-1.2.8/native_midi/native_midi_win32.c 2008-05-13 13:25:53.615000000 -0700 @@ -181,7 +181,7 @@ MMRESULT merr; HMIDISTRM MidiStream; - merr=midiStreamOpen(&MidiStream,&MidiDevice,1,(DWORD)&MidiProc,0,CALLBACK_FUNCTION); + merr=midiStreamOpen(&MidiStream,&MidiDevice,1,(DWORD_PTR)&MidiProc,0,CALLBACK_FUNCTION); if (merr!=MMSYSERR_NOERROR) MidiStream=0; midiStreamClose(MidiStream); Created attachment 284 [details]
DWORD_PTR patch for native_midi_win32
I think more changes are necessary to MidiProc for win64:
see, for example, a ptr is being cast to DWORD in the switch
statement. Can any of you guys review the attached patch?
Ozkan
Looks good, your patch is in for the next release. Thanks! |