Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xiph/speex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2007-06-23 08:15:31 +0400
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2007-06-23 08:15:31 +0400
commitd48d14e259788917b8ac509b8a0643273f15be1b (patch)
tree0451aa9e008b707cad2a347c9106a4f1e10bb9a2
parentdbe8ba33f33574aed72d3cbbf12163f9bdfb1071 (diff)
fixed potential leakSpeex-1.0
git-svn-id: http://svn.xiph.org/branches/speex-branches/speex-1.0-branch@13176 0101bb08-14d6-0310-b084-bc0e0c8e3800
-rw-r--r--src/speexdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/speexdec.c b/src/speexdec.c
index cffac99..085ff6d 100644
--- a/src/speexdec.c
+++ b/src/speexdec.c
@@ -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);