aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-01-13 02:14:54 +0100
committerClément Bœsch <ubitux@gmail.com>2012-01-13 16:22:25 +0100
commitf2193569a548fde059eb877661ec8a224c9fae1f (patch)
treef8b049730ecd87970a044db876daf3956cb45ef9 /libavcodec
parente3127db43877c7587975f58922b6087cea4ed706 (diff)
downloadffmpeg-f2193569a548fde059eb877661ec8a224c9fae1f.tar.gz
8svx: fix memleak in iff-fibonacci fate test.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/8svx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c
index a91f001531..f42a35b20b 100644
--- a/libavcodec/8svx.c
+++ b/libavcodec/8svx.c
@@ -110,7 +110,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
/* decode and interleave the first packet */
if (!esc->samples && avpkt) {
- uint8_t *deinterleaved_samples;
+ uint8_t *deinterleaved_samples, *p = NULL;
esc->samples_size = avctx->codec->id == CODEC_ID_8SVX_RAW || avctx->codec->id ==CODEC_ID_PCM_S8_PLANAR?
avpkt->size : avctx->channels + (avpkt->size-avctx->channels) * 2;
@@ -129,6 +129,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
}
if (!(deinterleaved_samples = av_mallocz(n)))
return AVERROR(ENOMEM);
+ p = deinterleaved_samples;
/* the uncompressed starting value is contained in the first byte */
if (avctx->channels == 2) {
@@ -145,6 +146,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
interleave_stereo(esc->samples, deinterleaved_samples, esc->samples_size);
else
memcpy(esc->samples, deinterleaved_samples, esc->samples_size);
+ av_freep(&p);
}
/* get output buffer */