Commit d48d14e2 authored by jm's avatar jm
Browse files

fixed potential leak


git-svn-id: http://svn.xiph.org/branches/speex-branches/speex-1.0-branch@13176 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent dbe8ba33
......@@ -311,6 +311,7 @@ static void *process_header(ogg_packet *op, int enh_enabled, int *frame_size, in
{
fprintf (stderr, "Mode number %d does not (yet/any longer) exist in this version\n",
header->mode);
free(header);
return NULL;
}
......@@ -323,17 +324,20 @@ static void *process_header(ogg_packet *op, int enh_enabled, int *frame_size, in
if (header->speex_version_id > 1)
{
fprintf (stderr, "This file was encoded with Speex bit-stream version %d, which I don't know how to decode\n", header->speex_version_id);
free(header);
return NULL;
}
if (mode->bitstream_version < header->mode_bitstream_version)
{
fprintf (stderr, "The file was encoded with a newer version of Speex. You need to upgrade in order to play it.\n");
free(header);
return NULL;
}
if (mode->bitstream_version > header->mode_bitstream_version)
{
fprintf (stderr, "The file was encoded with an older version of Speex. You would need to downgrade the version in order to play it.\n");
free(header);
return NULL;
}
......@@ -341,6 +345,7 @@ static void *process_header(ogg_packet *op, int enh_enabled, int *frame_size, in
if (!st)
{
fprintf (stderr, "Decoder initialization failed.\n");
free(header);
return NULL;
}
speex_decoder_ctl(st, SPEEX_SET_ENH, &enh_enabled);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment