Re: [AD] segfaulting on bad midis + workaround

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Wed, Jun 14, 2000 at 02:36:49PM +0200, Eduard Bloch wrote:
> I found the reason for my problems with the Allegro demo. The data-file
> was corrupted, but in a special way. I still could open it with grabber
> and play the midi files included there, but the game crashed while
> loading patches for this midi data. It costed me some time to find the
> reason, so I changed midi.c a bit: Now the users get a message when
> something similar happens.

I'm not sure that it's good for the library code to abort in
this case, or even display a message -- a better solution is to
make the `load_patches' function return nonzero, which causes
`play_midi' to return an error code.  You can put an error
message in `allegro_error', saying what went wrong, and rely on
the user to catch the error return from `play_midi', if they
care about it.

George

-- 
Random project update:
09/05/2000: Libnet 0.10.8 uploaded -- a few bugfixes
        http://www.canvaslink.com/libnet/  (try changes-0.10.8.txt)



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/