snd_mp3.c (S_MP3_CodecOpenStream): Don't Z_Free() stream's private

data when not allocating on the zone.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@479 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2011-08-21 09:10:52 +00:00
parent cf3c092a1d
commit f8eb60ae3d

View file

@ -308,7 +308,7 @@ static int mp3_decode(snd_stream_t *stream, byte *buf, int len)
i++;
}
p->cursamp++;
};
}
len -= donow;
done += donow;
@ -483,7 +483,7 @@ static int mp3_madseek(snd_stream_t *stream, unsigned long offset)
break;
}
}
};
}
return -1;
}
@ -517,15 +517,17 @@ static snd_stream_t *S_MP3_CodecOpenStream (const char *filename)
}
#endif
if (mp3_startread(stream) < 0)
{
Con_Printf("%s is not a valid MP3 file.\n", filename);
Z_Free(stream->priv);
S_CodecUtilClose(&stream);
return NULL;
}
if (mp3_startread(stream) == 0)
return stream;
return stream;
Con_Printf("%s is not a valid mp3 file\n", filename);
#if 0 /*defined(CODECS_USE_ZONE)*/
Z_Free(stream->priv);
#else
free(stream->priv);
#endif
S_CodecUtilClose(&stream);
return NULL;
}
static int S_MP3_CodecReadStream (snd_stream_t *stream, int bytes, void *buffer)