mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
avcodec/libvorbisdec: Fix memory leak
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
1435587373
commit
a450ec2672
@ -32,6 +32,8 @@ typedef struct OggVorbisDecContext {
|
|||||||
ogg_packet op; /**< ogg packet */
|
ogg_packet op; /**< ogg packet */
|
||||||
} OggVorbisDecContext;
|
} OggVorbisDecContext;
|
||||||
|
|
||||||
|
static int oggvorbis_decode_close(AVCodecContext *avccontext);
|
||||||
|
|
||||||
static int oggvorbis_decode_init(AVCodecContext *avccontext) {
|
static int oggvorbis_decode_init(AVCodecContext *avccontext) {
|
||||||
OggVorbisDecContext *context = avccontext->priv_data ;
|
OggVorbisDecContext *context = avccontext->priv_data ;
|
||||||
uint8_t *p= avccontext->extradata;
|
uint8_t *p= avccontext->extradata;
|
||||||
@ -110,8 +112,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
|
|||||||
return 0 ;
|
return 0 ;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
vorbis_info_clear(&context->vi);
|
oggvorbis_decode_close(avccontext);
|
||||||
vorbis_comment_clear(&context->vc) ;
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,6 +188,8 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, void *data,
|
|||||||
static int oggvorbis_decode_close(AVCodecContext *avccontext) {
|
static int oggvorbis_decode_close(AVCodecContext *avccontext) {
|
||||||
OggVorbisDecContext *context = avccontext->priv_data ;
|
OggVorbisDecContext *context = avccontext->priv_data ;
|
||||||
|
|
||||||
|
vorbis_block_clear(&context->vb);
|
||||||
|
vorbis_dsp_clear(&context->vd);
|
||||||
vorbis_info_clear(&context->vi) ;
|
vorbis_info_clear(&context->vi) ;
|
||||||
vorbis_comment_clear(&context->vc) ;
|
vorbis_comment_clear(&context->vc) ;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user