changeset 15425:2071633f9bdc

initialize vorbis structure before calling ERROR()
author nicodvb
date Thu, 12 May 2005 23:32:26 +0000
parents 148fbef7e95b
children 79008c38fcd9
files libmpcodecs/ad_libvorbis.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_libvorbis.c	Thu May 12 23:27:22 2005 +0000
+++ b/libmpcodecs/ad_libvorbis.c	Thu May 12 23:32:26 2005 +0000
@@ -72,6 +72,11 @@
     return 0; \
   }
 
+  /// Init the decoder with the 3 header packets
+  ov = (struct ov_struct_st*)malloc(sizeof(struct ov_struct_st));
+  vorbis_info_init(&ov->vi);
+  vorbis_comment_init(&vc);
+
   if(! sh->wf) {
     mp_msg(MSGT_DECAUDIO,MSGL_ERR,"ad_vorbis, extradata seems to be absent! exit\n");
     ERROR();
@@ -117,10 +122,6 @@
   hsizes[2] = sh->wf->cbSize - offset - hsizes[0] - hsizes[1];
   mp_msg (MSGT_DEMUX, MSGL_V, "ad_vorbis, header sizes: %d %d %d\n", hsizes[0], hsizes[1], hsizes[2]);
 
-  /// Init the decoder with the 3 header packets
-  ov = (struct ov_struct_st*)malloc(sizeof(struct ov_struct_st));
-  vorbis_info_init(&ov->vi);
-  vorbis_comment_init(&vc);
   for(i=0; i<3; i++) {
     op.bytes = hsizes[i];
     op.packet = headers[i];