summaryrefslogtreecommitdiff
path: root/libavcodec/libvorbisdec.c
diff options
context:
space:
mode:
authorAndrew Stone <a@stoney.io>2015-09-08 16:08:29 -0400
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-09 01:56:14 +0200
commita450ec267225baf431eefadcfacf15879256f363 (patch)
tree0f10a7e0144908a2322b70250b60d9fd4b9944b5 /libavcodec/libvorbisdec.c
parent14355873730229a48b6cb0c4eb845189d32a4808 (diff)
downloadffmpeg-a450ec267225baf431eefadcfacf15879256f363.tar.gz
avcodec/libvorbisdec: Fix memory leak
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/libvorbisdec.c')
-rw-r--r--libavcodec/libvorbisdec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/libvorbisdec.c b/libavcodec/libvorbisdec.c
index 2b22e057ec..ecf690a553 100644
--- a/libavcodec/libvorbisdec.c
+++ b/libavcodec/libvorbisdec.c
@@ -32,6 +32,8 @@ typedef struct OggVorbisDecContext {
ogg_packet op; /**< ogg packet */
} OggVorbisDecContext;
+static int oggvorbis_decode_close(AVCodecContext *avccontext);
+
static int oggvorbis_decode_init(AVCodecContext *avccontext) {
OggVorbisDecContext *context = avccontext->priv_data ;
uint8_t *p= avccontext->extradata;
@@ -110,8 +112,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
return 0 ;
error:
- vorbis_info_clear(&context->vi);
- vorbis_comment_clear(&context->vc) ;
+ oggvorbis_decode_close(avccontext);
return ret;
}
@@ -187,6 +188,8 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, void *data,
static int oggvorbis_decode_close(AVCodecContext *avccontext) {
OggVorbisDecContext *context = avccontext->priv_data ;
+ vorbis_block_clear(&context->vb);
+ vorbis_dsp_clear(&context->vd);
vorbis_info_clear(&context->vi) ;
vorbis_comment_clear(&context->vc) ;