]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libvorbisdec.c
Merge commit 'bbf71d46db3417b43bcbd745cbf235e8e2ff69ae'
[ffmpeg] / libavcodec / libvorbisdec.c
index 2b22e057ecc3d0f48f20202d20dac46013fd4e84..ecf690a5530128eef311ff8870b94ab689c40bcc 100644 (file)
@@ -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) ;