[CVE-2017-14633]: Don't allow for more than 256 channels
[platform/upstream/libvorbis.git] / lib / info.c
index c4706b0..ecced14 100644 (file)
@@ -578,7 +578,7 @@ int vorbis_analysis_headerout(vorbis_dsp_state *v,
   oggpack_buffer opb;
   private_state *b=v->backend_state;
 
-  if(!b){
+  if(!b||vi->channels<=0||vi->channels>256){
     ret=OV_EFAULT;
     goto err_out;
   }