vorbis: avoid invalid free
authorTristan Matthews <tmatth@videolan.org>
Thu, 9 Nov 2017 07:30:14 +0000 (02:30 -0500)
committerTristan Matthews <tmatth@videolan.org>
Fri, 10 Nov 2017 17:50:36 +0000 (12:50 -0500)
Regression started at commit "4b67376 Remove multiple subtly different inline..."

lib/info.c

index 971f004..fe759ed 100644 (file)
@@ -647,7 +647,7 @@ int vorbis_analysis_headerout(vorbis_dsp_state *v,
   memset(op_code,0,sizeof(*op_code));
 
   if(b){
-    oggpack_writeclear(&opb);
+    if(vi->channels>0)oggpack_writeclear(&opb);
     if(b->header)_ogg_free(b->header);
     if(b->header1)_ogg_free(b->header1);
     if(b->header2)_ogg_free(b->header2);