Patch to fix bug in smpeg-0.4.4

If SMPEG_new() is given a file which does not exist, an uninitialized
field in an object of class MPEG causes SMPEG_delete() to core dump
(or cause other undesirable havoc).

The problem is that the ‘source’ field in an object of class MPEG is
uninitialized, but the destructor function checks if it’s NULL, and if
not, calls SDL_RWclose() with it.

Here’s the simple patch to properly initialize the variable when an
error occurs opening the file:

— MPEG.cpp~ Mon Jun 18 16:54:23 2001
+++ MPEG.cpp Wed Dec 26 12:10:15 2001
@@ -134,6 +134,8 @@
system = NULL;
error = NULL;

  • source = NULL;+
    audiostream = videostream = NULL;
    audioaction = NULL;
    videoaction = NULL;