NewCreature / Allegro-Legacy

Make Your Allegro 4 Programs Run On Modern Systems Using Allegro 5
19 stars 3 forks source link

EXCEPTION_ACCESS_VIOLATION_WRITE in windows _midia5_platform_send_data #39

Closed connorjclark closed 7 months ago

connorjclark commented 7 months ago

I have a user crash report that lands in this method: https://zeldaclassic.sentry.io/share/issue/97684d22a3a146f1851588b9fd77e424/

It seems that cm_data is null here.

My expectation is that if midia5_create_output_handle failed (due to _midia5_init_output_platform_data not being able to get a MIDIA5_PLATFORM_DATA handle), then a5_midi_init (allegro5 midi init method) would fail and so midi_driver->raw_midi should be null now. Perhaps that's not the case?

The user that reported this crash was able to fix this by running something called Codec Tweak Tool (following this guide)

NewCreature commented 7 months ago

This looks like a bug in MIDIA5. When creating an output handle with midia5_create_output_handle(), the platform-specific code it defers to has the potential to return NULL. When this happens, midia5_create_output_handle() should fail and return NULL instead of the partially initialized handle.

NewCreature commented 7 months ago

Fixed in dc2d68ad51598d0d0c3b94b4cff905a409cc6ecf.